fix(workflow) fix mothership double-running workflows#3614
fix(workflow) fix mothership double-running workflows#3614TheodoreSpeaks merged 2 commits intostagingfrom
Conversation
PR SummaryMedium Risk Overview Written by Cursor Bugbot for commit a7a5443. This will update automatically on new commits. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes a bug where workflows triggered through the Mothership chat were executed twice — once server-side (due to
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant MothershipRoute as /api/mothership/chat
participant createSSEStream
participant Orchestrator
Client->>MothershipRoute: POST (message, workspaceId, ...)
MothershipRoute->>createSSEStream: orchestrateOptions { interactive: true }
createSSEStream->>Orchestrator: orchestrateCopilotStream(..., interactive: true [hardcoded])
Note over Orchestrator: interactive=true → waits for client decisions
Orchestrator-->>Client: SSE: tool_call event
Client-->>Orchestrator: Tool decision / client-side execution result
Orchestrator-->>Client: SSE: tool_result event
Orchestrator-->>Client: SSE: done event
Note over MothershipRoute: onComplete: persists assistant message to DB
MothershipRoute-->>Client: Stream ends
Note left of Orchestrator: Before fix (interactive=false):<br/>Server auto-executed tools AND<br/>client executed them too → double-run
Last reviewed commit: 5b586b0 |
* fix(workflow) fix mothership double-running workflows * Remove interactive override --------- Co-authored-by: Theodore Li <theo@sim.ai>
Summary
Previously mothership ran workflows ran twice - both client and server side. I switched the booleans to be client side so we don't run the same execution on the server.
Type of Change
Testing
Validated that executions only create a single run.
Checklist
Screenshots/Videos