-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(tools): fixed tool outputs #2325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR refactors tool outputs across multiple integrations (Asana, Confluence, OneDrive, HubSpot, Pipedrive, Google Groups, Google Vault) by flattening nested response structures and improving error handling. Key Changes
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant ToolConfig
participant APIRoute
participant ExternalAPI
participant FileUtils
Note over Client,FileUtils: Tool Output Flattening Pattern
Client->>ToolConfig: Execute tool (e.g., asana_get_task)
ToolConfig->>APIRoute: POST request with params
APIRoute->>ExternalAPI: Fetch data from external service
ExternalAPI-->>APIRoute: Return API response
APIRoute->>APIRoute: Transform to flat structure
Note over APIRoute: Returns {success, ts, gid, name, ...}<br/>instead of {success, output: {...}}
APIRoute-->>ToolConfig: Flat JSON response
ToolConfig->>ToolConfig: transformResponse() extracts {success, error, ...output}
ToolConfig-->>Client: Flattened output structure
Note over Client,FileUtils: File Upload Flow (OneDrive/Confluence)
Client->>ToolConfig: Upload file with params
ToolConfig->>APIRoute: POST with file reference
APIRoute->>FileUtils: processSingleFileToUserFile()
FileUtils-->>APIRoute: UserFile object
APIRoute->>FileUtils: downloadFileFromStorage()
FileUtils-->>APIRoute: File buffer
APIRoute->>FileUtils: getExtensionFromMimeType()
FileUtils-->>APIRoute: File extension
APIRoute->>APIRoute: Add extension to filename if needed
APIRoute->>ExternalAPI: Upload file with proper headers
ExternalAPI-->>APIRoute: Upload response
APIRoute-->>Client: Success with file metadata
Note over Client,FileUtils: Error Handling (Confluence)
Client->>APIRoute: Create page with invalid spaceId
APIRoute->>APIRoute: Validate spaceId format (numeric check)
APIRoute-->>Client: Helpful error message with guidance
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
80 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
83 files reviewed, no comments
Summary
Fix for various variable references, file uploading in onedrive, confluence error handling. Fixed and tested as I went.
Fixes #(issue)
Type of Change
Testing
Tested manually
Checklist