feat(tasks): re-dispatch resumes the prior transcript + jump from a session to its task (v0.320.0) - #585
Merged
Merged
Conversation
…of restarting A task is the durable unit of work; a session is one attempt. Every other re-entry path (chat threads, DM replies, poke-back, self-schedule) --resumes the prior transcript — task re-dispatch was the lone exception, spawning a FRESH session with only a text summary of the last run's outcome, so a retried/reopened task re-derived everything (files read, decisions, half-done work). dispatchTask now resumes the SAME transcript when the task's latest run was the same assignee agent and pinned one (resumableTaskTranscript), seeded with a "continue, don't restart" prompt. Bounded: after MAX_TASK_RESUMES (2) resumes that still don't close it, it starts FRESH to escape a wedged transcript — a fresh run mints a new claude_session_id, so the streak resets and the LAST attempt before parking is a clean slate. TASK_MAX_ATTEMPTS 3→4 so the ladder (fresh → resume → resume → fresh-escape → park) fits before the block. A changed assignee can't resume another agent's transcript → fresh. Because a resumed dispatch reuses the transcript id, retries also collapse into ONE conversation in the chain/cost view (cost = max) instead of N separate ones. Pinned by scripts/task-resume-test.cjs (wired into test:governance), 17 assertions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The session view could not reach the task it was working — the edge only existed the other way (task room → its runs). The session facts row now renders a clickable task chip when the run has a task/poke/ask provenance (Session.taskId, already stamped by listSessions' chainLinks), deep-linking to the board card via the same #/tasks/<id> route the inbox uses. Also moves the v0.320.0 CHANGELOG heading in for the task-resume change shipped alongside. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vikasprogrammer
added a commit
that referenced
this pull request
Aug 8, 2026
…1) (#589) #588 branched off v0.319.0 and bumped to v0.319.1. #585 merged v0.320.0 in the meantime, so #588's squash carried its own package.json back over it: main landed on 0.319.1 with 0.320.0's code in it, and the CHANGELOG listed 0.319.1 above 0.320.0. The live instapods box then reported 0.319.1 while running both changes. That matters because the sidebar/`/health` version is how we tell which build a long-running server is holding in memory — the first thing checked when a change "isn't taking". A version that moves backwards makes that check lie. Renames the 0.319.1 heading to 0.320.1 (the patch on top of 0.320.0, which is what the code actually is), bumps package.json to match, and updates the Step 0 reference in docs/insights-revisit.md. No code change. Claude-Session: https://claude.ai/code/session_01AiTKjtdcF4ESbuYVWj2CfU Co-authored-by: Claude Opus 5 (1M context) <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.
Two related task changes.
1. A task re-dispatch RESUMES the prior transcript (not a fresh restart)
A task is the durable unit of work; a session is one attempt. Every other re-entry path — chat threads, DM replies, poke-back, self-schedule — already
--resumes the prior transcript. Task re-dispatch was the lone exception: it spawned a fresh session with only a text summary of the last run's outcome (priorRuns), so a retried or reopened task re-derived everything it had already worked out (files read, decisions, half-done work).dispatchTasknow resumes the same transcript when the task's latest run was the same assignee agent and pinned one (TerminalManager.resumableTaskTranscript), seeded with a "continue, don't restart" prompt.Bounded — the ladder you land on a failing task:
MAX_TASK_RESUMES = 2— after two resumes that don't close the task, start fresh to escape a wedged/looping transcript. A fresh run mints a newclaude_session_id, so the streak resets and the last attempt before parking is a clean slate rather than a third reload of a poisoned context.TASK_MAX_ATTEMPTS3 → 4 so the escape-fresh attempt actually runs before the block. (Flagged: this nudges the global per-task retry budget by one.)Pinned by
scripts/task-resume-test.cjs(wired intotest:governance) — 17 assertions covering the full ladder, the same-agent guard, and the escape minting a new transcript.2. Jump from a session to its attached task
The session view couldn't reach the task it works — the edge only existed the other way (task room → its runs). The session facts row now shows a clickable task chip when the run has a
task:/poke:/ask:provenance (Session.taskId, already stamped bylistSessions'chainLinks), deep-linking to the board card via the same#/tasks/<id>route the inbox uses.Verification
npm run build+cd web && npm run build+ fullnpm run test:governancegreen (incl. the new task-resume test).🤖 Generated with Claude Code