Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added special handling for workflow tool in agent tool input
  • clear search query in popover when it reopens
  • added react grab and accompanying feature flag

Type of Change

  • Bug fix
  • New feature

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)

@vercel
Copy link

vercel bot commented Jan 14, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 14, 2026 11:26pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 14, 2026

Greptile Summary

Added React Grab debugging tool integration, workflow tool icon rendering, and combobox search query clearing. The PR introduces a feature-flagged React Grab integration for UI debugging in development environments, adds visual support for workflow tools with proper icon rendering, and fixes a UX issue where search queries persisted when reopening the combobox.

Key Changes:

  • Added REACT_GRAB_ENABLED environment variable and isReactGrabEnabled feature flag (dev-only)
  • Integrated React Grab scripts from unpkg CDN with conditional loading in root layout
  • Added isWorkflowTool handling with WorkflowIcon and purple background color in tool input component
  • Fixed combobox to clear search query on close (Escape, blur, selection) preventing stale queries on reopen

Issues Found:

  • Critical: Incomplete isWorkflowTool checks in tool-input.tsx - workflow tools will incorrectly execute code paths meant for standard tools (getToolIdForOperation, getToolParametersConfig, toolRequiresOAuth, hasMultipleOperations) causing potential runtime errors

Confidence Score: 2/5

  • This PR has critical logic bugs that will cause runtime errors for workflow tools
  • While the React Grab integration and combobox fixes are solid, the workflow tool implementation is incomplete. Multiple conditional branches check !isCustomTool && !isMcpTool but omit !isWorkflowTool, causing workflow tools to incorrectly execute standard tool logic paths. This will likely cause errors when users interact with workflow tools.
  • Pay close attention to apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx - the workflow tool handling is incomplete and needs all conditional branches updated

Important Files Changed

Filename Overview
apps/sim/lib/core/config/feature-flags.ts Added isReactGrabEnabled feature flag that enables React Grab only in dev mode
apps/sim/app/layout.tsx Conditionally loads React Grab scripts from unpkg CDN when feature flag is enabled
apps/sim/components/emcn/components/combobox/combobox.tsx Added search query clearing when combobox closes to prevent stale queries on reopen
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx Added workflow tool icon rendering support, but missing isWorkflowTool checks in multiple conditional branches causing potential bugs

Sequence Diagram

sequenceDiagram
    participant User
    participant Layout
    participant FeatureFlags
    participant ToolInput
    participant Combobox
    
    User->>Layout: Load application
    Layout->>FeatureFlags: Check isReactGrabEnabled
    alt isDev && REACT_GRAB_ENABLED
        FeatureFlags-->>Layout: true
        Layout->>Layout: Load React Grab scripts from unpkg
    else
        FeatureFlags-->>Layout: false
        Layout->>Layout: Skip React Grab scripts
    end
    
    User->>ToolInput: Select workflow tool
    ToolInput->>ToolInput: Set isWorkflowTool = true
    ToolInput->>ToolInput: Render WorkflowIcon with #6366F1 color
    Note over ToolInput: BUG: Missing !isWorkflowTool checks<br/>in getToolIdForOperation,<br/>getToolParametersConfig, etc.
    
    User->>Combobox: Open dropdown
    User->>Combobox: Search for options
    User->>Combobox: Select option
    Combobox->>Combobox: Close dropdown
    Combobox->>Combobox: Clear search query
    User->>Combobox: Reopen dropdown
    Note over Combobox: Search query is now empty
Loading

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.

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

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.

Additional Comments (4)

  1. apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx, line 2208-2211 (link)

    logic: Missing !isWorkflowTool check. Workflow tools will incorrectly call getToolIdForOperation which is meant for standard tools.

  2. apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx, line 2214-2217 (link)

    logic: Missing !isWorkflowTool check. Workflow tools will incorrectly attempt to fetch tool parameters config.

  3. apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx, line 2275 (link)

    logic: Missing !isWorkflowTool check. Workflow tools will incorrectly be checked for multiple operations.

  4. apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx, line 2269-2272 (link)

    logic: Missing !isWorkflowTool checks. Workflow tools will incorrectly be processed as standard tools in these conditionals.

5 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 41f9374 into staging Jan 14, 2026
10 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/tool-inp branch January 15, 2026 17:25
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