Repository navigation
fix(codex): unblock replies after native children finish - #175246
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: needs real behavior proof before merge. What this changesRelease parent execution protection once all native children finish while retaining their results for delivery and retry. Example: Both child-a and child-b finish while their results await delivery.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a current-main parent-resume deadlock with a focused change; no actionable code findings remain. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Codex native-subagent monitor receives child completion notifications, manages parent subscription protection, and hands captured results to the existing completion-delivery owner. flowchart TD
A[Native child completion] --> B[Subagent monitor]
B --> C[Captured pending result]
B --> D[Parent execution protection]
C --> E[Completion delivery and retry]
D --> F[Parent cold resume]
E --> F
Technical reviewBest possible solution: Keep the terminal-aware release rule in the existing monitor while preserving the existing completion-custody and retry owners. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the circular dependency between pending child delivery and the protected-parent cold-resume guard; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is the smallest complete repair for pin timing: it uses existing terminal state and protection ownership without introducing a protection taxonomy or changing delivery authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 28212a985c15. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +10, Tests +100, Docs +5. Total +115 across 4 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label 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 HistoryReviewed October 18, 2026, 9:42 PM ET / October 19, 2026, 01:42 UTC (Revision 3). |
|
Field report: we applied a minimal local backport of this PR's monitor change (head It appears to be helping in normal use. The previously affected agent has resumed work. Its subsequent report confirmed receipt and consumption of a native child's result, and a later read-only check showed it actively executing code inspections and browser checks, rather than remaining stuck at the previous Validation and limits:
Thanks for the focused fix. Our current assessment is positive operational feedback, not yet a complete end-to-end pass for pending-result cold resume. |
|
Thanks for the focused fix. One concern before merge: this change appears to break an existing custody contract, and PR CI did not run the test that guards it. What fails. The test states the invariant directly: "A receipt cannot release custody still owned by the accepted delivery." With this patch, Why CI was green. The changed-extensions bundles (jobs 117332412490 / 117332412463 in run 39010615187) did not select the contention test file. The codex app-server files they ran are listed in the job logs; Scope of this evidence. I ran the test on the 2026.10.3 source with this PR's exact monitor change transplanted in (the asserted block is unchanged on current Possible direction. The circular wait is real: the parent pin waits for delivery to settle, and the delivery's own cold resume is refused because of that pin. One way to break it without dropping custody is to type each protection holder:
The monitor would mark its pin as delivery-custody only when every child for that parent is terminal and an accepted completion is being delivered. It would unmark if a new child registers. Admission would then require no native-work holder, plus no claim or the exact finished foreground owner's deferred release. Generation would be rechecked after each await. That is in the same spirit as #172145, which separates child subscription custody from foreground turn authority. I have a working version of this against 2026.10.3, with real-module regressions, and can share it if useful. Related: a large share of these cold resumes seem to come from spurious warm-reuse misses on completion turns (#153354, #171954). Fixing those reduces how often the guard is reached at all. |
Keep the focused terminal-child parent-pin fix and update contention regressions to verify live delivery admission and retained results directly. Clean up the new boundary fixture and document parent resume behavior. Related: openclaw#172837 Original parent-pin fix by @quqi1599 in openclaw#175246. Contention assertions adapted from @Stronggenetics in openclaw#176177. Durable abandonment from openclaw#173018 remains unchanged. Live proof intentionally skipped; PR CI owns runtime proof. Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Stronggenetics <[email protected]>
|
Updated at Changed-file lint/format and isolated P0–P2 autoreviews pass. The body records exact scope, LOC, remaining issue aspects, and validation limits. PR CI is the proof per maintainer policy; live Gateway, leases, local suites/typechecks, and production negative controls were intentionally skipped. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Main typecheck regression found while attributing Gateway PR #176814:
Exact CI job 117862036438 Reporting to the owning Codex area; the Gateway cleanup changes none of these |
…5246) * fix(codex): resume replies while child results await delivery * fix(codex): preserve delivery custody after parent pin release Keep the focused terminal-child parent-pin fix and update contention regressions to verify live delivery admission and retained results directly. Clean up the new boundary fixture and document parent resume behavior. Related: openclaw#172837 Original parent-pin fix by @quqi1599 in openclaw#175246. Contention assertions adapted from @Stronggenetics in openclaw#176177. Durable abandonment from openclaw#173018 remains unchanged. Live proof intentionally skipped; PR CI owns runtime proof. Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Stronggenetics <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]>
Adapt the focused fix and two-child cold-resume regression from openclaw#175246. Keep pending completion custody and verify it through admitted child execution. Co-authored-by: quqi1599 <[email protected]>
* fix(codex): preserve parents across private core-tool transitions * fix(codex): defer tool catalog changes under native work * test(codex): align lifecycle fixtures with stable tool declarations * fix(codex): validate retained catalog executors and receipts * fix(codex): keep catalog adapters typed and cycle free * test(codex): assert completion guards at invocation * test(codex): launch isolated adapter fixture with Node under Bun * fix(codex): validate accepted catalog execution and receipts * fix(codex): preserve complete per-turn conversation context * fix(codex): preserve steering media roots and handoff fixtures * test(codex): consolidate accepted catalog executor regressions * fix(codex): repair accepted catalog recovery and preparation Adapt the scoped fingerprint and surviving executor cohort corrections from #176177 while retaining in-place projection and receipt guards. Co-authored-by: Stronggenetics <[email protected]> * fix(agents): preserve native completion input admission Adapt completion context projection and optional System native hooks from #176177. Preserve required admission and strict lifecycle fixture assertions. Co-authored-by: Stronggenetics <[email protected]> * fix(codex): release parent protection after children finish Adapt the focused fix and two-child cold-resume regression from #175246. Keep pending completion custody and verify it through admitted child execution. Co-authored-by: quqi1599 <[email protected]> * fix(codex): preserve clients after busy preflight refusal Use the existing preflight rejection contract for claimed or protected threads, as proposed in #176177. Preserve abort and transport retirement. Co-authored-by: Stronggenetics <[email protected]> * test(codex): answer repeated settlement policy reads * fix(codex): join assignment publication before completion delivery * docs(codex): clarify nonrelay creation-policy retention * fix(codex): preserve first reply after app discovery Leave tool-disabled discovery transitions with the existing lifecycle owner and preserve strict native catalog validation. Align continuity fixtures with persisted native metadata and the optional hook-policy preflight. * test(codex): keep the preflight cursor local --------- Co-authored-by: Ricardo Almeida <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Paul Bohm <[email protected]>
…aw#174900) * fix(codex): preserve parents across private core-tool transitions * fix(codex): defer tool catalog changes under native work * test(codex): align lifecycle fixtures with stable tool declarations * fix(codex): validate retained catalog executors and receipts * fix(codex): keep catalog adapters typed and cycle free * test(codex): assert completion guards at invocation * test(codex): launch isolated adapter fixture with Node under Bun * fix(codex): validate accepted catalog execution and receipts * fix(codex): preserve complete per-turn conversation context * fix(codex): preserve steering media roots and handoff fixtures * test(codex): consolidate accepted catalog executor regressions * fix(codex): repair accepted catalog recovery and preparation Adapt the scoped fingerprint and surviving executor cohort corrections from openclaw#176177 while retaining in-place projection and receipt guards. Co-authored-by: Stronggenetics <[email protected]> * fix(agents): preserve native completion input admission Adapt completion context projection and optional System native hooks from openclaw#176177. Preserve required admission and strict lifecycle fixture assertions. Co-authored-by: Stronggenetics <[email protected]> * fix(codex): release parent protection after children finish Adapt the focused fix and two-child cold-resume regression from openclaw#175246. Keep pending completion custody and verify it through admitted child execution. Co-authored-by: quqi1599 <[email protected]> * fix(codex): preserve clients after busy preflight refusal Use the existing preflight rejection contract for claimed or protected threads, as proposed in openclaw#176177. Preserve abort and transport retirement. Co-authored-by: Stronggenetics <[email protected]> * test(codex): answer repeated settlement policy reads * fix(codex): join assignment publication before completion delivery * docs(codex): clarify nonrelay creation-policy retention * fix(codex): preserve first reply after app discovery Leave tool-disabled discovery transitions with the existing lifecycle owner and preserve strict native catalog validation. Align continuity fixtures with persisted native metadata and the optional hook-policy preflight. * test(codex): keep the preflight cursor local --------- Co-authored-by: Ricardo Almeida <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Paul Bohm <[email protected]>
* fix(codex): resume replies while child results await delivery * fix(codex): preserve delivery custody after parent pin release Keep the focused terminal-child parent-pin fix and update contention regressions to verify live delivery admission and retained results directly. Clean up the new boundary fixture and document parent resume behavior. Related: #172837 Original parent-pin fix by @quqi1599 in #175246. Contention assertions adapted from @Stronggenetics in #176177. Durable abandonment from #173018 remains unchanged. Live proof intentionally skipped; PR CI owns runtime proof. Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Stronggenetics <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> (cherry picked from commit 4caee42)
* fix(codex): resume replies while child results await delivery * fix(codex): preserve delivery custody after parent pin release Keep the focused terminal-child parent-pin fix and update contention regressions to verify live delivery admission and retained results directly. Clean up the new boundary fixture and document parent resume behavior. Related: #172837 Original parent-pin fix by @quqi1599 in #175246. Contention assertions adapted from @Stronggenetics in #176177. Durable abandonment from #173018 remains unchanged. Live proof intentionally skipped; PR CI owns runtime proof. Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Stronggenetics <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> Release adaptation: the stable child-unregister path keeps its thread-status revision collection after the shared terminal-children release helper. Tests drop the main-only listPendingChildren probes; delivery results still prove retained completions. (cherry picked from commit 4caee42)
* fix(codex): resume replies while child results await delivery * fix(codex): preserve delivery custody after parent pin release Keep the focused terminal-child parent-pin fix and update contention regressions to verify live delivery admission and retained results directly. Clean up the new boundary fixture and document parent resume behavior. Related: #172837 Original parent-pin fix by @quqi1599 in #175246. Contention assertions adapted from @Stronggenetics in #176177. Durable abandonment from #173018 remains unchanged. Live proof intentionally skipped; PR CI owns runtime proof. Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Stronggenetics <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> (cherry picked from commit 4caee42) Adapted for 2026.9.x: the terminal-child parent-pin release is applied to 9.x's applyNativeReceipts call site and unregisterChild, keeping 9.x's collectThreadStatusRevision call. listPendingChildren assertions are dropped from the contention and parent-retention tests (no such 9.x API); the retained-result and delivery assertions remain. The f9da044 test follow-up is not needed because 9.x still accepts completionDeliveryRetryDelaysMs.
* fix(codex): preserve parents across private core-tool transitions * fix(codex): defer tool catalog changes under native work * test(codex): align lifecycle fixtures with stable tool declarations * fix(codex): validate retained catalog executors and receipts * fix(codex): keep catalog adapters typed and cycle free * test(codex): assert completion guards at invocation * test(codex): launch isolated adapter fixture with Node under Bun * fix(codex): validate accepted catalog execution and receipts * fix(codex): preserve complete per-turn conversation context * fix(codex): preserve steering media roots and handoff fixtures * test(codex): consolidate accepted catalog executor regressions * fix(codex): repair accepted catalog recovery and preparation Adapt the scoped fingerprint and surviving executor cohort corrections from #176177 while retaining in-place projection and receipt guards. Co-authored-by: Stronggenetics <[email protected]> * fix(agents): preserve native completion input admission Adapt completion context projection and optional System native hooks from #176177. Preserve required admission and strict lifecycle fixture assertions. Co-authored-by: Stronggenetics <[email protected]> * fix(codex): release parent protection after children finish Adapt the focused fix and two-child cold-resume regression from #175246. Keep pending completion custody and verify it through admitted child execution. Co-authored-by: quqi1599 <[email protected]> * fix(codex): preserve clients after busy preflight refusal Use the existing preflight rejection contract for claimed or protected threads, as proposed in #176177. Preserve abort and transport retirement. Co-authored-by: Stronggenetics <[email protected]> * test(codex): answer repeated settlement policy reads * fix(codex): join assignment publication before completion delivery * docs(codex): clarify nonrelay creation-policy retention * fix(codex): preserve first reply after app discovery Leave tool-disabled discovery transitions with the existing lifecycle owner and preserve strict native catalog validation. Align continuity fixtures with persisted native metadata and the optional hook-policy preflight. * test(codex): keep the preflight cursor local --------- Co-authored-by: Ricardo Almeida <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Paul Bohm <[email protected]> (cherry picked from commit c853069) Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Ricardo Almeida <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Paul Bohm <[email protected]> (cherry picked from commit fc45a245649396b047de614842c5ec72cda3bc43)
* fix(codex): preserve parents across private core-tool transitions * fix(codex): defer tool catalog changes under native work * test(codex): align lifecycle fixtures with stable tool declarations * fix(codex): validate retained catalog executors and receipts * fix(codex): keep catalog adapters typed and cycle free * test(codex): assert completion guards at invocation * test(codex): launch isolated adapter fixture with Node under Bun * fix(codex): validate accepted catalog execution and receipts * fix(codex): preserve complete per-turn conversation context * fix(codex): preserve steering media roots and handoff fixtures * test(codex): consolidate accepted catalog executor regressions * fix(codex): repair accepted catalog recovery and preparation Adapt the scoped fingerprint and surviving executor cohort corrections from #176177 while retaining in-place projection and receipt guards. Co-authored-by: Stronggenetics <[email protected]> * fix(agents): preserve native completion input admission Adapt completion context projection and optional System native hooks from #176177. Preserve required admission and strict lifecycle fixture assertions. Co-authored-by: Stronggenetics <[email protected]> * fix(codex): release parent protection after children finish Adapt the focused fix and two-child cold-resume regression from #175246. Keep pending completion custody and verify it through admitted child execution. Co-authored-by: quqi1599 <[email protected]> * fix(codex): preserve clients after busy preflight refusal Use the existing preflight rejection contract for claimed or protected threads, as proposed in #176177. Preserve abort and transport retirement. Co-authored-by: Stronggenetics <[email protected]> * test(codex): answer repeated settlement policy reads * fix(codex): join assignment publication before completion delivery * docs(codex): clarify nonrelay creation-policy retention * fix(codex): preserve first reply after app discovery Leave tool-disabled discovery transitions with the existing lifecycle owner and preserve strict native catalog validation. Align continuity fixtures with persisted native metadata and the optional hook-policy preflight. * test(codex): keep the preflight cursor local --------- Co-authored-by: Ricardo Almeida <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: quqi1599 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Paul Bohm <[email protected]> Bounded adaptation: six strict run-attempt ordering expectations only (eight physical-client sequences); split invalid-image expectations adapted. No production, catalog or private-context hunks replayed. Canonical final-p1-r0-c85306952ac7 remains NOT fully implemented. Adapted-from: c853069
…5246) Backport quqi1599 and maintainer changes from openclaw#175246 (4caee42). Adapt the terminal transition to the 2026.10.7 markTerminalRevision owner and prove retained results through delivery because this release has no listPendingChildren API. Preserve running and interrupted child protection, release terminal parent execution pins, and retain pending result delivery custody. Focused source and built-artifact regression checks pass. Independent review reported no actionable findings.
Related: #172837
What Problem This Solves
Replies can fail with “Codex thread … is claimed by active work; stop it first” after every native child has finished, because pending completion delivery still protects the parent against the cold resume needed to receive the result.
User Impact
The parent can resume after all child results have been captured. Pending results retain delivery ownership and retry; running and resumable children, accepted submissions, and current foreground owners keep their existing protection. No configuration or migration is required.
Why This Change Was Made
Release the existing parent execution pin when every registered child is terminal, and reuse that rule when unregistering a child. Completion custody, receipts, retry budgets, successful delivery, and durable abandonment remain with their existing owners. #173018 already handles exact-assignment retirement on give-up; #173563 preserves it. This PR fixes the separate pin-timing gap, not historical exhaustion lacking durable evidence.
The human review identified three contention tests that treated the execution pin as a proxy for delivery custody. They now verify delivery admission and pending-result retention directly, including receipt arrival, retired-turn receipts, retry, and retirement while a handoff is in flight. No protection-holder taxonomy or additional lifecycle state is needed.
Original fix by @quqi1599; maintainer cleanup updates the contention contract, regression cleanup, and documentation. The focused contention-test repair is adapted from @Stronggenetics's #176177. That PR's broader catalog and completion-context changes are not superseded; #174900 also integrates this pin fix in a broader contributor proposal.
Deferred-effect facts: the pin-release decision reads the monitor's current child states and retention map synchronously, with no intervening await. Completion status/result and child/parent identities are the captured terminal facts; existing delivery checks revalidate monitor identity, requester binding, and completion custody at admission and after awaited delivery. This change adds no deferred configuration, path, limit, or authority snapshot.
Evidence
Candidate
4aa2c5c1635fa318957c02fbb2200353ffb87473cleanly merges main64e9443af525212642b0406fbc454727f267a68a, including CLI ratchet repaire63269c28a22a6eec7c0758d54dc6dbe674e2886. The four PR files are byte-identical to the reviewed previous head. Changed-file oxlint/oxfmt pass after the merge. Fresh exact-head CI run 39183982150 is successful: 32 jobs passed, 30 skipped, zero failures. The baseline ratchet, both changed-extension bundles, production/test types, and lint pass. No inherited-failure exception is needed. The completed ClawSweeper review covers this exact head (2026-10-19 01:42:52 UTC), reports findings=0, and retains only a proof hold. Verbatim verdict: “Codex review: needs real behavior proof before merge.” PR CI is the proof per maintainer policy; live proof and negative controls were intentionally skipped.bc529a16db05b80e3baca5455e9ff6e263aed3be; no additional durable-assignment implementation is added. Native source inspected atbe2951ea34f0d295ed0becf97079f92fa5f6950e:codex-rs/core/src/agent/control.rs::maybe_start_completion_watcherandmulti_agent_v2_followup_task_completion_notifies_parent_on_every_turnincodex-rs/core/src/tools/handlers/multi_agents_tests.rs.permits parent cold resume once every child is terminal, while preserving undelivered results. It reaches the production release guard, retains protection with a running sibling, then permits release and preserves both result retries.rechecks receipt while completion delivery is in flight,rechecks retired-turn-receipt while completion delivery is in flight, andrechecks retirement while completion delivery is in flight.9b2a9c9dd64d) PR CI ran 609 tests across 39 extension test files, all passing. The parent cold-resume regression passed in 19 ms; the receipt / retired-turn-receipt / retirement contention cases passed in 16 / 9 / 3 ms. Bundle 1 ran 271 tests across 21 files (228 s job wall time); bundle 2 ran 338 tests across 18 files (243 s). CI invokedtime -p node --import tsx scripts/ci-run-node-test-shard.mtswith its selected plans. Production types, test types, and lint passed in jobs 117834769707, 117834769756, and 117834769748. Local tests, typechecks, live Gateway/Crabbox/Testbox proof, and production negative controls were intentionally skipped per maintainer policy. No leases were created. The case timings above are CI-reported test time, not isolated full-file wall time; no local runtime duration is claimed.git diff --checkis included.Exact numstat against the merged main base: production +15/−5, tests +104/−4, docs +5/−0 (total +124/−9). The necessary production growth is one shared terminal-aware release rule replacing the unregister-only rule; no new owner, state, exported helper, schema, or configuration was added. Unrelated deletions would obscure the fix.
Previous CI failure repaired on main
Previous-head run 39181207427 passed the Codex tests, types, lint, and docs but failed the unrelated
root-help.test.tsmock-export ratchet. Main repaired it in e63269c28a22 by preserving real sub-CLI exports and removing the obsolete baseline row. The new merge commit includes that repair and triggers fresh CI; the old merge-ref run was not rerun.