Conversation
* Fix task switching causing stream to abort * Process all task streams all the time * Process task streams that are in the background --------- Co-authored-by: Theodore Li <theo@sim.ai>
|
You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace. To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR delivers a set of targeted fixes for the mothership chat/copilot flow: routing the Key changes:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant MCP as MCP Client
participant Route as CopilotMcpRoute
participant Auth as WorkflowAuthorizer
participant Orch as ChatOrchestrator
participant Tools as ToolHandlers
participant QC as QueryCache
MCP->>Route: tool call with agentId build
Route->>Route: handleBuildToolCall
alt workflowId provided
Route->>Auth: check workspace permission
Auth-->>Route: allowed or denied
else no workflowId
Route->>Route: resolve workflow for user
end
Route->>Orch: stream with fast mode and auto-execute
Orch->>Tools: run each tool call in sequence
Tools-->>Orch: tool results with deployment status
Orch-->>Route: aggregated content and tool calls
Route-->>MCP: JSON result
Note over QC: After deploy tool succeeds
QC->>QC: invalidate deployment info query
QC->>QC: invalidate deployment versions query
QC->>QC: invalidate workflow list query
Last reviewed commit: 7316482 |
| if (!resolved?.workflowId) { | ||
| return { | ||
| content: [ | ||
| { | ||
| type: 'text', | ||
| text: JSON.stringify( | ||
| { | ||
| success: false, | ||
| error: 'workflowId is required for build. Call create_workflow first.', | ||
| }, | ||
| null, | ||
| 2 | ||
| ), | ||
| }, | ||
| ], | ||
| isError: true, | ||
| } | ||
| } |
There was a problem hiding this comment.
Misleading error message when authorization fails
When a workflowId is supplied but authorizeWorkflowByWorkspacePermission returns allowed: false, resolved becomes null and the function returns the error "workflowId is required for build. Call create_workflow first." This message implies the caller forgot to provide a workflow ID, when the actual problem is a permissions failure. An LLM acting as an MCP client will likely misinterpret this and try creating a new workflow instead of flagging an access error.
Consider returning a distinct message for the authorization-failed path:
// in the IIFE block
return authorization.allowed ? { workflowId } : { error: 'not_authorized' }
…and checking resolved?.error separately from the missing-ID case.
apps/sim/lib/copilot/orchestrator/tool-executor/deployment-tools/deploy.ts
Show resolved
Hide resolved
|
You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace. To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard. |
|
You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace. To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard. |
* Fix deploy subagent * fix(stream) handle task switching (#3609) * Fix task switching causing stream to abort * Process all task streams all the time * Process task streams that are in the background --------- Co-authored-by: Theodore Li <theo@sim.ai> * Always return isDeployed for undeploy chat * Fix lint --------- Co-authored-by: Siddharth Ganesan <siddharthganesan@gmail.com> Co-authored-by: Theodore Li <theo@sim.ai>
Summary
Merge fixes for mothership
Type of Change
Testing
Tested each change individually
Checklist
Screenshots/Videos