Repository navigation
fix: finish replies to subagent results after a Gateway restart - #200924
Conversation
|
🦞👀 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 Summary: ✅ CompletedThis 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: needs maintainer review before merge. What this changesResume interrupted requester turns whose subagent results are already committed, while settling those results without replay. Example: The Gateway crashes after CAPTURED_CUSTODY_RESULT reaches the requester transcript but before the requester answers.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a current restart-recovery defect through the existing owners, with no concrete correctness or security finding. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe subagent registry delivers child results into requester conversations; Gateway startup recovers interrupted turns using persisted lifecycle and transcript facts. flowchart TD
A[Child result] --> B[Registry completion owner]
B --> C[Requester transcript]
C --> D[Gateway restart classification]
D --> E[Fresh turn admission]
E --> F[Requester reply]
C --> B
Technical reviewBest possible solution: Keep registry ownership for unconsumed results and use ordinary Gateway recovery to finish interrupted turns with committed input. Do we have a high-confidence way to reproduce the issue? The current-main classification and post-dispatch consumed check expose the reported path, corroborated by the base failure recorded in this PR and the preceding merged repair; no target code was executed during this review. Is this the best way to solve the issue? The patch repairs the ownership boundary using existing transcript receipts and restart admission, and preserves deliberate yield rather than introducing another replay mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3460f6178601. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +35, Tests +15, Docs +6. Total +56 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
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 November 17, 2026, 9:30 PM ET / November 18, 2026, 02:30 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
(cherry picked from commit 61daf4c) Co-authored-by: RomneyDa <[email protected]>
…200924) Release adaptation: Reviewed committed-input restart classification and consumed-cohort dedup; preserve partition cancellation and ambiguity/refusal guards. Move reviewed Gateway-closure extraction to its introducing row15 so each source pick remains below line cap. Policy combination exposed stage20 700->702 line-cap growth. Pure relocation of captured generation and unchanged predicate together into existing requester-settle-state owner (capture retains value snapshot/type guard and undefined-generation comparison); no assertions/coverage removed. Predicate-only intermediate still measured701; complete capture reduces wake to700. (cherry picked from commit 61daf4c) Co-authored-by: RomneyDa <[email protected]>
|
It's happening and I'm not happy. Are we good? He is mirroring GitHub through chrome and saying the entire thing was fake? |
What Problem This Solves
A Gateway restart can interrupt a requester after it has read a subagent result but before it answers. Crash recovery could leave that requester parked indefinitely, so the result was present in its conversation but the user never received the final reply.
User Impact
The Gateway resumes that interrupted requester turn from its saved conversation. Completion inputs are delivered once, and intentional Stop and current authority checks still apply. No protocol, schema, or configuration changes are required.
Why This Change Was Made
Startup classified any retained requester-settle cohort as yield-waiting, including an interrupted execution whose exact settle input was already committed (
session-restart-resume.ts:511on base). The registry's consumed-input check ran only after dispatch (subagent-announce.requester-settle-wake.ts:648on base), allowing an unnecessary resubmission to conflict with the committed input.Gateway restart-resume now recognizes the committed input for the interrupted settle run and uses the existing restart admission and continuation path. The registry settles consumed receipts before dispatch. This preserves delivered-on-commit semantics: the registry owns unconsumed results, while the Gateway owns completing a requester turn that already consumed its input. No new state, continuation owner, replay path, or authority fallback is added; queued-input ordering and store/cancellation guards remain intact.
The existing graceful-shutdown checkpoint now permits
delivered, as required by #200249. The final assertions still requireHUB_RECEIVED_RESTART_COMPLETION, exactly one completion input, exactly one final reply, and no duplicate after a second restart. Self-simplification retained the existing owners and receipts. The test budget is raised from zero to exactly +15 net lines to extend an existing parked-requester case with a real committed settle input; no additional Gateway boot or test case is added. An ended execution without a terminal status remains deliberately yielded, preserving registry ownership of its wait.Evidence
On base
8f16d1323f8fac4dec49d97267f5c11edf30ef8c, after correcting that checkpoint, the focused command reports 1 failed, 1 passed, 8 skipped:(announcing-crash)missesHUB_RECEIVED_RESTART_COMPLETION; graceful(announcing)passes. The earlier uncorrected cases both failed on the base and head of #200873, as recorded there.This proof runs isolated real Gateway processes, a synthetic local model endpoint, and native SQLite custody across graceful shutdown, process crashes, and subsequent restarts. It includes public/private announcing, nested, captured, busy, retrying, unmarked, and stale-settle cases.
All 89 focused tests pass across restart, requester dispatch, and custody suites, including real Stop, authority refusal, queued inputs, and deliberate yield. The extended committed-input yield case first failed against the initial candidate (1 failed, 9 skipped) and then passed with the lifecycle distinction. Core and affected Gateway/root-test typechecks, touched-file lint/format, line-cap and identity ratchets, and the final
pnpm buildpass. Fresh independent Codex autoreview is scoped-clean through P2.The local broad sibling command completed four shards with 842 passed before its remaining agents-support shard was stopped under shared-host contention; that incomplete shard is not claimed as passing. Exact-head PR CI supplies the remaining broad proof.
Related: #200873, #200823, #200249.
Inherited CI failures
CI run 44221908417 fails only
checks-node-changed-3and its aggregate gate. Its two Workshop learning cases reproduce on both this PR and the exact CI main baselinee93a426be3297ed947f54b4e15c87827225b6c90(2 failed on each): the review request exceeds the old 64 KiB expectation, and the learned-skill notice is absent. The first expectation predates #200545, which intentionally removed that clamp; the notice failure is also inherited. The failing tests and inspected Workshop/fork source inputs are unchanged in the tested merge. Security and all other jobs pass. These failures remain recorded as failures and use the native inherited-failure landing exception.