Repository navigation
fix: steered sessions fail to resume after restart - #170252
Conversation
Keep the interrupted human turn's retained source claim when a steering message becomes the transcript tail. Preserve downstream authorization and delegated-source refusal. Co-authored-by: steipete <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesPreserve a human-started turn’s recovery claim when an inter-session steering message becomes its latest transcript input. Example: The human run human-run-with-steering receives a sessions_send update before a Gateway restart.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: it addresses a concrete recovery failure still present on current main, and its collaborator authorship independently prevents automatic closure. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup recovery reads interrupted session claims and transcript checkpoints, then either settles, refuses, or dispatches a continuation through the normal agent owner. flowchart TD
A[Interrupted session] --> B[Saved source claim]
A --> C[Transcript checkpoint]
B --> D[Recovery source classification]
C --> D
D --> E[Current authority admission]
E --> F[Agent continuation]
F --> G[Guarded final effect]
Technical reviewBest possible solution: Keep source classification with the existing recovery owner while preserving current authority checks through execution and delivery. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically refuses the supplied retained-human-claim/inter-session-tail input; the author reports a failing-before/passing-after regression, which was inspected but not executed during this read-only review. Is this the best way to solve the issue? The narrow predicate change addresses the mistaken source classification without adding another recovery owner or removing downstream authorization checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 432d890350b0. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete bypass was found, but the expanded authority admission path requires final-effect verification. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +48, Docs +6. Total +59 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 5:25 PM ET / 21:25 UTC. |
|
Merged via squash.
|
Keep the interrupted human turn's retained source claim when a steering message becomes the transcript tail. Preserve downstream authorization and delegated-source refusal. Co-authored-by: steipete <[email protected]> (cherry picked from commit 3b93ac3)
Backport of 3b93ac3 (#170252) adapted for 2026.10.3. Applied the retained-human-source guard to 10.3's inter_session refusal by hand (the store diverged heavily). Regression rewritten in 10.3's fixture style: control-ui/channel steered turns resume, an unscoped control-ui steering tail still tombstones. Docs keep only this PR's paragraph. Co-authored-by: steipete <[email protected]> (cherry picked from commit 3b93ac3)
Keep the interrupted human turn's retained source claim when a steering message becomes the transcript tail. Preserve downstream authorization and delegated-source refusal. Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes conversations being permanently marked failed after a Gateway restart when another session had steered the active human-started turn.
User Impact
Interrupted conversations can resume without requiring a replacement session merely because a steering update was the latest transcript input. Authorization, revocation, delivery, and replay-safety checks remain unchanged. This does not automatically reopen sessions already marked failed.
Why This Change Was Made
Steering updates are context inside the active turn, not a new owner of that turn. Recovery now preserves a retained, source-keyed human Control UI or channel claim instead of classifying the whole turn from its latest transcript entry. Unscoped and internal delegated inputs still fail closed.
Evidence
Isolated live Gateway proof
On this head, an actual compiled Gateway received authenticated public RPCs and a real
sessions_send(mode: "steer")tool invocation, persisted the original human claim and steering update, then was killed and replaced by a new process on the same SQLite database. Model I/O used a deterministic local HTTP/SSE fixture—not live inference.done, exactly one final reply, and file effects exactlybefore\nafter\n.device.token.revokecaused an error/killed outcome; zero final replies or after-effects and no bypass retry.All six Gateway processes and the owned container were confirmed absent afterward; no operator service/state was changed. Production source SHA-256:
63889225b7d642ecf82d70e97e9e8b283bf46d9464fc30bea528ad1243a92bea.Fixture limitation: the live suite exited 1 (2 passed, 1 failed). After the delegated-denial and zero-effect assertions passed, its final notice assertion incorrectly expected an internal reason in
chat.history. The captured response correctly contained the public replacement-session notice. That one expectation was corrected and checked against the recorded response; the corrected full case was not rerun. This is not reported as a three-test green suite. Cold build: 20m32s; live cases: 93.5s. The temporary proof fixture is not part of the product patch.Reported and requested by @steipete.
Work sessions