fix(tool-calls): remove redundant input/output fields in favor of arguments/response, exclude isExpanded for tools in agents in workflow change detection#1630
Merged
Conversation
…uments/response, exclude isExpanded for tools in agents in workflow change detection
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR removes redundant tool call fields and fixes workflow change detection to ignore UI-only state.
- In
agent-handler.ts: Removes redundantinputandoutputfields from theformatToolCallmethod. Providers already returnargumentsandresult, andtrace-spans.tshandles backward compatibility by mapping both field names - In
utils.ts: AddssanitizeToolsForComparisonfunction to strip theisExpandedUI field from tools before comparing workflows, preventing false positives in change detection. This pattern is consistent with existing sanitization injson-sanitizer.ts
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- Both changes are well-isolated bug fixes with clear intent. The tool call field removal is safe because providers use
arguments/resultand backward compatibility is maintained intrace-spans.ts. The workflow comparison fix follows existing patterns and prevents false positives without affecting functionality - No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/executor/handlers/agent/agent-handler.ts | 5/5 | Removes redundant input and output fields from tool call formatting, keeping only arguments and result |
| apps/sim/lib/workflows/utils.ts | 5/5 | Adds sanitization to exclude isExpanded UI field when comparing tools in workflow change detection |
Sequence Diagram
sequenceDiagram
participant Provider as AI Provider
participant Handler as AgentBlockHandler
participant TraceSpans as trace-spans.ts
participant Utils as workflows/utils.ts
participant DB as Database
Note over Provider,Handler: Tool Call Field Standardization
Provider->>Handler: toolCalls with arguments/result
Handler->>Handler: formatToolCall()<br/>(returns arguments/result only)
Handler->>TraceSpans: Pass formatted tool calls
TraceSpans->>TraceSpans: Map to input/output<br/>for backward compatibility
TraceSpans->>DB: Store with input/output fields
Note over Utils,DB: Workflow Change Detection
Utils->>DB: Fetch current workflow state
Utils->>DB: Fetch deployed workflow state
Utils->>Utils: sanitizeToolsForComparison()<br/>(remove isExpanded)
Utils->>Utils: hasWorkflowChanged()<br/>compare sanitized values
Utils-->>Handler: true/false (workflow changed)
2 files reviewed, no comments
Sg312
pushed a commit
that referenced
this pull request
Oct 15, 2025
…uments/response, exclude isExpanded for tools in agents in workflow change detection (#1630)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually
Checklist