Repository navigation
fix(sessions): settle unrestorable requester recovery once - #174177
Conversation
Retire historical requester inputs after missing original authority or an explicit current-grant denial, preserving their sessions and captured results. Keep startup availability failures retryable and avoid re-marking terminal interrupted work on the next boot.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis PR settles permanently unrestorable requester inputs once, preserves their results, and keeps temporary recovery failures retryable. Example: Gateway startup discovers agent:main:main with source announce:requester-settle:legacy-cohort and no restorable operator authority.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a current restart-recovery retry loop, has established maintainer direction, and introduces no definite code defect found in this review. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup recovery reads persisted session claims and subagent cohorts, restores current operator authority, and either admits a requester continuation or records a terminal interruption through the existing persistence owners. flowchart TD
A[Gateway startup] --> B[Session recovery claims]
B --> C[Registry cohort restoration]
C --> D[Current operator policy]
D --> E[Authorized requester continuation]
C --> F[Permanent failure settlement]
F --> G[Transcript notice and terminal claims]
Technical reviewBest possible solution: Retire only definitively unrestorable inputs through the existing owners, preserve their results, and retain retry custody for temporary failures. Do we have a high-confidence way to reproduce the issue? Current main visibly retains failed requester-recovery claims, and the supplied startup regression reports the expected failing baseline; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch addresses the retained obligation at its existing registry and session owners, preserves transient retries, and avoids introducing fallback authority or a competing recovery store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a2676def7241. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +195, Tests +337, Docs +3. Total +535 across 15 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 16, 2026, 8:12 AM ET / 12:12 UTC. |
…174177) * fix(sessions): settle unrestorable requester recovery once Retire historical requester inputs after missing original authority or an explicit current-grant denial, preserving their sessions and captured results. Keep startup availability failures retryable and avoid re-marking terminal interrupted work on the next boot. * test(sessions): verify terminal requester recovery through Gateway
What Problem This Solves
Requester continuations whose original operator authority cannot be restored remained recovery candidates on every Gateway boot, repeating the same preparation failure across startup retries.
User Impact
Definitively unrestorable inputs now settle once as interrupted. The session, transcript, workspace, and successful child results remain available for a fresh authenticated message. Any saved replayable reply is retained in the local interruption notice. Recovery does not send an external notice or create a system-authorized follow-up.
Why This Change Was Made
The existing registry restoration owner distinguishes missing/mismatched evidence and an explicit current-grant denial from transient startup failures. Its existing batch settlement operation retires the exact cohort wake. Main-session recovery atomically writes one idempotent interruption notice and clears the old claims; startup marking respects that terminal result instead of creating another claim merely because the session remains interrupted.
The scheduler keeps bounded retries for transient failures because readiness can change without a session-row revision. Permanent failures no longer trigger repeated preparation. No retry cache, schema migration, configuration option, permission expansion, or retention change is introduced.
Follow-up to #174134.
Evidence
settled=0, failed=2. With this change, the first pass reportssettled=1, failed=1; the second retries only the temporary failure, and the next boot discovers 0 candidates for the legacy input. Exactly one transcript notice remains, with saved reply text preserved.SessionEntrytype to satisfy the test typecheck. Incremental independent review is scoped clean.23f912d780e85e35ea44ac8f267bd881ceba07ef, including the session test typecheck, Gateway tests, baseline ratchets, security check, and PostgreSQL conformance: CI run.Simplification uses the existing batch mutation, transcript transaction, terminal fences, and worker filter. The redundant inner preparation catch is removed. Production code grows by 195 lines (tests: +337 lines) because the requested durable terminal outcome and permanent/transient distinction were missing; there is no new state schema or competing recovery owner.
Validation uses synthetic state only. No production restart or deployment was performed, and there is no new production startup timing measurement. Broad validation belongs to PR CI; no Testbox lease was allocated.
The earlier CI run exposed two test-only issues: an inferred-union fixture type and existing Gateway expectations for the old retry-forever behavior. Both are corrected. Its unrelated media assertion-baseline mismatch was reproduced identically on the PR and main; the baseline check now passes on the current CI merge tree.