Repository navigation
fix(mothership): Stop only cancels detached runs still running, and a held workflow run never blocks the next turn's workbench - #9532
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no actionable new issues were found. SummaryThis PR narrows Stop to detached workflow runs that are still running and lets a later turn use the workbench while an earlier workflow run continues.
No actionable new issues were found. Tests were inspected, not run.
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
e4ec6c3 to
19c9072
Compare
… held workflow run never blocks the next turn's workbench
…and name the paused case Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s read with its result Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19c9072 to
335ad5c
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Follow-ups to #9507 found in the release audit:
getDetachedWorkflowExecutionsreturned every execution a call in the stream ever detached, and Stop wrote the durable 14-day cancel flag for each. A run paused at a human-in-the-loop block resumes under the same execution id, read the flag, and was cancelled. Stop now cancels only runs whose log readsrunning(or that have no log yet, i.e. still starting); paused runs are left alone, matching the pre-feat(mothership): answer a long workflow tool run still running, and stop detached runs on Stop #9507 behaviour where a paused browser run was already settledanswerWithinWaitretains the run so the call'sexecutionSettledAtstays null while it runs;prepareWorkbenchAccesscounted that ashandlersPending, so everyrun_code/sandbox call in the next turn failed for up to 95 minutes. Workflow-tool rows (which never touch the chat's workbench) no longer count; their unsettled sandbox processes still feed recoverysim_clistdout of a stopped turnWORKFLOW_TOOL_NAMESinstead of a duplicate list; explicit settled-state tracking inanswerWithinWaitinstead of aPromise.raceordering trick; the admission log poll is capped at 60 s past the waitType of Change
Testing
workflow-client-settlement.integration.ts(real Postgres + Redis): detached CLI and tool runs whose log ispending/completed/failed/cancelledare not cancelled; a run answered still running with no log yet still is; a later turn's workbench access isn't blocked by an earlier still-runningrun_workflow, while an earlierfunction_executestill blocks (control). Ran locally: 21/21; with the pre-fix repository 5 failtools/handlers/workflow,async-runs,request/application,request/handlers(209 pass); biome; full gate in CIChecklist
test-auditauthoring gate)