-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(copilot): fix copilot server bugs #2855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes several copilot server bugs and adds UX improvements including continue options, cleaner option displays, and diff display on new chats. Key Changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CopilotUI as Copilot UI
participant CopilotStore as Copilot Store
participant ChatAPI as Chat API Route
participant EditTool as Edit Workflow Tool
participant DeployTool as Deploy Tools
participant DiffStore as Workflow Diff Store
participant StatusAPI as Status API
User->>CopilotUI: Send message (mode: 'agent')
CopilotUI->>CopilotStore: sendMessage()
CopilotStore->>CopilotStore: Capture workflow snapshot
CopilotStore->>ChatAPI: POST /api/copilot/chat (mode: 'agent')
ChatAPI->>ChatAPI: Transform mode: 'agent' → 'build'
ChatAPI->>ChatAPI: Use selectedModel for non-azure/vertex
ChatAPI-->>CopilotStore: Stream response
alt Workflow Edit Tool Called
CopilotStore->>EditTool: execute()
EditTool->>EditTool: Check hasExecuted (prevent duplicates)
EditTool->>EditTool: Normalize array subblock IDs
EditTool->>DiffStore: Apply workflow diff
DiffStore->>DiffStore: Check if diff is empty
alt Diff has changes
DiffStore->>DiffStore: Apply diff optimistically
DiffStore->>CopilotStore: saveMessageCheckpoint()
CopilotStore->>CopilotStore: Persist workflow snapshot
else No changes detected
DiffStore->>DiffStore: Skip diff view
end
EditTool-->>CopilotStore: markToolComplete()
end
alt Deploy Chat Tool Called
CopilotStore->>DeployTool: execute()
DeployTool->>StatusAPI: GET /api/workflows/{id}/chat/status
StatusAPI-->>DeployTool: Return existing deployment
alt Has existing deployment
DeployTool->>DeployTool: Merge args with existing values
DeployTool->>DeployTool: PATCH /api/chat/manage/{id}
else No existing deployment
DeployTool->>DeployTool: POST /api/chat
end
DeployTool-->>CopilotStore: markToolComplete()
end
alt Deploy MCP Tool Called
CopilotStore->>DeployTool: execute()
DeployTool->>DeployTool: POST /api/mcp/workflow-servers/{id}/tools
alt Already exists error
DeployTool->>DeployTool: Fetch existing tool
DeployTool->>DeployTool: PATCH /api/mcp/workflow-servers/{id}/tools/{toolId}
DeployTool-->>CopilotStore: Return updated tool
else Success
DeployTool-->>CopilotStore: Return new tool
end
end
CopilotStore->>CopilotStore: Abort all in-progress tools
CopilotStore->>CopilotStore: Clear subAgentStreaming flags
CopilotStore->>CopilotUI: Update message with continue options
CopilotUI-->>User: Display response with options
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25 files reviewed, 2 comments
...nents/panel/components/copilot/components/copilot-message/hooks/use-checkpoint-management.ts
Show resolved
Hide resolved
...nents/panel/components/copilot/components/copilot-message/hooks/use-checkpoint-management.ts
Outdated
Show resolved
Hide resolved
…d continue button
6300d3e to
0e55455
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
26 files reviewed, 1 comment
Summary
Fix copilot server bugs
Adds a few ux improvements (continue options, options outside thinking text, diff on new chat)
Type of Change
Testing
Manual
Checklist