Repository navigation
fix(tasks): Unblock & run can no longer double-spawn; card shows session state (v0.455.0) - #854
Merged
Merged
Conversation
…session's state (v0.455.0) The console dispatch (guard:false) skipped the one-live-run-per-task check, so a second click on the blocked-task card — or a click while the blocking run was still up — spawned a parallel session on the same task. canDispatch now refuses a live run on every path; the route returns the live session id. The blocked card is hydrated with the task's current run (alive/ended) and offers Open session while it is live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
"Unblock & run" on a Task blocked — needs you card sometimes spawned multiple sessions for one task. Live instapods evidence:
tsk_ad11e51…gotses_f2d5…andses_4291…two seconds apart (two PATCH→todo + dispatch pairs from the same owner).Cause:
POST /api/tasks/:id/dispatchcallsdispatchTask(guard:false), andcanDispatchskipped the one-live-run check whenguardwas false. The card re-enabled its buttons after the first action and lingers until the next feed poll, so a second click spawned again; a click while the blocking run was still up did the same.Fix
canDispatchrefuses a live current run on every path.guard:falsestill un-parksblockedand skips the pool/per-agent caution.{ live: true, sessionId }on that refusal.args.run(session id, alive/ended, status) via the new batchedTerminalManager.taskRunStates(liveTaskRunsnow delegates to it), computed only when such a card is on the page.Tests
scripts/unblock-run-dedupe-test.cjs(added totest:governance): 12 checks; 6 of them fail on the oldcanDispatch. Fullnpm run test:governancegreen; typecheck + web build clean.🤖 Generated with Claude Code