Skip to content

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Dec 5, 2025

Summary

Fix copilot tool call flash

Type of Change

  • Bug fix

Testing

Manual

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 Dec 5, 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 Dec 5, 2025 11:10pm

@Sg312 Sg312 changed the title Fix/copilot flash fix(copilot): fix tool call flash Dec 5, 2025
@Sg312 Sg312 merged commit 9f604f3 into staging Dec 5, 2025
5 checks passed
@Sg312 Sg312 mentioned this pull request Dec 5, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 5, 2025

Greptile Overview

Greptile Summary

Fixed a UI flash where Run/Skip buttons briefly appeared for auto-allowed integration tools before auto-executing.

  • Added isAutoAllowed check using useCopilotStore.getState().isToolAutoAllowed(toolCall.name) in the shouldShowRunSkipButtons function
  • Prevents buttons from showing when an integration tool is in pending state but is auto-allowed (will auto-execute without user interaction)
  • The fix targets integration tools in build mode that would previously show confirmation buttons momentarily before the auto-execution logic kicked in

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a focused bug fix that adds a simple boolean check to prevent UI flash. The logic is sound - if a tool is auto-allowed, it shouldn't show confirmation buttons. The implementation properly uses existing store methods and follows the codebase patterns. No breaking changes or side effects expected.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx 5/5 Added check to prevent showing Run/Skip buttons for auto-allowed integration tools to fix UI flash

Sequence Diagram

sequenceDiagram
    participant User
    participant ToolCallComponent as ToolCall Component
    participant Store as CopilotStore
    participant Backend as Integration Tool Backend
    
    User->>ToolCallComponent: Integration tool triggered
    ToolCallComponent->>ToolCallComponent: shouldShowRunSkipButtons()
    ToolCallComponent->>Store: getState().mode
    ToolCallComponent->>Store: isToolAutoAllowed(toolCall.name)
    
    alt Tool is auto-allowed
        Store-->>ToolCallComponent: true
        Note over ToolCallComponent: Buttons NOT shown (no flash)
        ToolCallComponent->>Backend: Auto-execute tool
    else Tool is not auto-allowed
        Store-->>ToolCallComponent: false
        ToolCallComponent-->>User: Show Run/Skip buttons
        User->>ToolCallComponent: Click "Allow" or "Always Allow"
        ToolCallComponent->>Backend: Execute tool
    end
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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the fix/copilot-flash branch December 7, 2025 02:15
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