Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • remove redundant input/output fields in favor of arguments/response
  • exclude isExpanded for tools in agents in workflow change detection

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…uments/response, exclude isExpanded for tools in agents in workflow change detection
@vercel
Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 15, 2025 0:17am

@waleedlatif1 waleedlatif1 merged commit e83d3a6 into staging Oct 15, 2025
9 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 redundant input and output fields from the formatToolCall method. Providers already return arguments and result, and trace-spans.ts handles backward compatibility by mapping both field names
  • In utils.ts: Adds sanitizeToolsForComparison function to strip the isExpanded UI field from tools before comparing workflows, preventing false positives in change detection. This pattern is consistent with existing sanitization in json-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/result and backward compatibility is maintained in trace-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)
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the sim-72 branch October 15, 2025 00:24
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants