improvement(forwarding+excel): added forwarding and improve excel read#1136
improvement(forwarding+excel): added forwarding and improve excel read#1136icecrasher321 merged 7 commits intostagingfrom
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR adds email forwarding functionality to the Outlook integration, completing the email management capabilities alongside existing send, draft, and read operations. The implementation follows established patterns in the codebase by creating a new outlookForwardTool that integrates with Microsoft Graph API's forward endpoint.
The changes span multiple layers of the architecture:
- Core tool implementation: A new
forward.tsfile defines the tool configuration with OAuth authentication, parameter validation, and API integration - Type definitions: New interfaces
OutlookForwardParamsandOutlookForwardResponseextend the existing Outlook type system - Block integration: The Outlook block configuration now includes a "Forward Email" operation with conditional input fields for message ID and optional comments
- Registry updates: The new tool is properly registered in both the tools index and main registry for discoverability
- Infrastructure improvements: Enhanced error handling in the core request handler to support Microsoft Graph API's HTTP 202 responses for async operations
The forward tool requires a messageId to identify the email to forward, recipient email addresses in the to parameter, and accepts an optional comment to include with the forwarded message. The implementation uses the same OAuth provider (outlook) and follows the consistent ToolConfig pattern used throughout the email tools.
Additionally, the PR includes an unrelated improvement to the Microsoft Excel read tool, adding support for sheet-only range inputs (e.g., Sheet1 without explicit cell ranges) and fixes an inconsistency in the Outlook read tool's output schema to align with its actual response format.
Confidence score: 3/5
- This PR has several implementation issues that need attention before merging
- Score reflects concerns about response handling inconsistencies and missing validation in the forward tool
- Pay close attention to
apps/sim/tools/outlook/forward.tsfor response structure mismatches and error handling gaps
8 files reviewed, 5 comments
|
|
||
| const logger = createLogger('Tools') | ||
|
|
||
| // Extract a concise, meaningful error message from diverse API error shapes |
There was a problem hiding this comment.
ah nvm this is the same thing as existing code I think
apps/sim/tools/index.ts
Outdated
| logger.error(`[${requestId}] Internal API error for ${toolId}:`, { | ||
| status: errorInfo?.status, | ||
| errorData: errorInfo?.data, | ||
| status: (errorToTransform as any).status, |
There was a problem hiding this comment.
we shouldn't move towards any typing....why are we making these changes?
| rawEmail?: OutlookEmail // Only included when includeRawEmail is true | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
can we use a library func for this....doing this ourselves is almost certainly going to break something
There was a problem hiding this comment.
yeah changing rn
#1136) * added forwarding for outlook * lint * improved excel sheet read * addressed greptile * fixed bodytext getting truncated * fixed any type * added html func --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
…is for queueing docs in kb (#1143) * improvement(kb): created knowledge, chunks, tags services and use redis for queueing docs in kb * moved directories around * cleanup * bulk create docuemnt records after upload is completed * fix(copilot): send api key to sim agent (#1142) * Fix api key auth * Lint * ack PR comments * added sort by functionality for headers in kb table * updated * test fallback from redis, fix styling * cleanup copilot, fixed tooltips * feat: local auto layout (#1144) * feat: added llms.txt and robots.txt (#1145) * fix(condition-block): edges not following blocks, duplicate issues (#1146) * fix(condition-block): edges not following blocks, duplicate issues * add subblock update to setActiveWorkflow * Update apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/condition-input.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix dependency array * fix(copilot-cleanup): support azure blob upload in copilot, remove dead code & consolidate other copilot files (#1147) * cleanup * support azure blob image upload * imports cleanup * PR comments * ack PR comments * fix key validation * improvement(forwarding+excel): added forwarding and improve excel read (#1136) * added forwarding for outlook * lint * improved excel sheet read * addressed greptile * fixed bodytext getting truncated * fixed any type * added html func --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> * revert agent const * update docs --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
simstudioai#1136) * added forwarding for outlook * lint * improved excel sheet read * addressed greptile * fixed bodytext getting truncated * fixed any type * added html func --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
…is for queueing docs in kb (simstudioai#1143) * improvement(kb): created knowledge, chunks, tags services and use redis for queueing docs in kb * moved directories around * cleanup * bulk create docuemnt records after upload is completed * fix(copilot): send api key to sim agent (simstudioai#1142) * Fix api key auth * Lint * ack PR comments * added sort by functionality for headers in kb table * updated * test fallback from redis, fix styling * cleanup copilot, fixed tooltips * feat: local auto layout (simstudioai#1144) * feat: added llms.txt and robots.txt (simstudioai#1145) * fix(condition-block): edges not following blocks, duplicate issues (simstudioai#1146) * fix(condition-block): edges not following blocks, duplicate issues * add subblock update to setActiveWorkflow * Update apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/condition-input.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix dependency array * fix(copilot-cleanup): support azure blob upload in copilot, remove dead code & consolidate other copilot files (simstudioai#1147) * cleanup * support azure blob image upload * imports cleanup * PR comments * ack PR comments * fix key validation * improvement(forwarding+excel): added forwarding and improve excel read (simstudioai#1136) * added forwarding for outlook * lint * improved excel sheet read * addressed greptile * fixed bodytext getting truncated * fixed any type * added html func --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> * revert agent const * update docs --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Summary
Added forward email in outlook and improved reading excel sheets when user inputs no range.
Type of Change
Testing
Tested by forwarding emails to different addresses. Tested by adding excel sheets without ranges and just the excel sheet name.
Checklist
Screenshots/Videos
Screen.Recording.2025-08-26.at.4.30.45.PM.mov