fix(tasks): resume the session on transient retry #36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/retry-resumes-session"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A transient fault can land many minutes into a long task. Requeuing without a resume pointer discarded that work and restarted from the original prompt, so a stream that broke near the end simply burned the retry budget for no progress.
The worker already supports this:
resume_session_idin task metadata is the equivalent ofcodetether run --session <id>, andtask_session_loadcontinues that session when present instead of resolving a fresh one. The requeue path just never set it.next_metadatanow carries the session forward, preferring an explicitresume_session_id, then the worker-reportedworker_session_id, thensession_id. Derivedtask-<id>sessions are excluded because they hold streamed narration rather than agent state — resuming one would restore no reasoning context.Temporal stage boundaries are deliberately left alone:
reviewshould not inherit thebuildsession, and each stage already receives its own context.Validation: 46 tests pass, covering carry-forward, explicit-pointer precedence, derived-session exclusion, blank values, and resume surviving repeated attempts.