Repository navigation
fix(codex): unblock parents after native follow-up completion - #177577
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
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. |
|
The PR body now includes explicit reproduction/environment details, the completed real V1 Gateway follow-up/next-request smoke, and passing required CI on @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRelease the redundant submission execution hold after the native follow-up is admitted to the existing monitor. Example: Child turn B completes with result B_RESULT while its delivery acknowledgment remains pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a remaining parent-resume lockout on current main with a minimal ownership handoff and no actionable correctness findings. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Codex plugin observes native follow-up submissions and hands admitted child execution to its monitor; completion custody and binding receipts independently preserve pending results. flowchart TD
A[Native send_input] --> B[Submission owner]
B --> C[Child monitor]
C --> D[Active execution protection]
C --> E[Completion delivery]
B --> F[Pending receipt]
E --> G[Delivery acknowledgment]
G --> F
Technical reviewBest possible solution: Land the existing submission-to-monitor handoff after the required checks pass, preserving receipt settlement and completion custody. Do we have a high-confidence way to reproduce the issue? The source establishes the retained submission pin, and supplied baseline/fixed native execution captures and independent regression results demonstrate the failure; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete repair for the stated follow-up lockout: release the redundant hold after successful admission while retaining the existing monitor, completion, and receipt owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6113057491a2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource 0, Tests +55. Total +55 across 2 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 HistoryReviewed October 24, 2026, 8:13 PM ET / October 25, 2026, 00:13 UTC (Revision 3). |
|
Addressed the sole proof request in #177577 (comment). The PR body now embeds inspectable redacted execution captures: real Codex baseline/fixed pending-ack replay (active guard rejection, completed B notification, cold resume while receiptCount=1, and one receipt consumption), plus actual live Gateway native lifecycle and terminal-receipt readback. The captured fixed source SHA-256 matches the committed owner file. Fixture boundaries and the earlier observer-only miscount remain explicit. No source changes; exact-head CI remains green. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Maintainer landing path: please refresh exact-head review for |
|
Also quoting @Stronggenetics here: the contention/parent-retention contract this PR builds on came through #176177 (and was already adapted into #175246). Thanks for that groundwork. @clawsweeper status |
|
@clawsweeper re-review |
|
Independent validation in support of this fix. Without the patch, both follow-up acknowledgment orderings failed at parent cold resume with We applied the production deltas from #179099 (
The interrupted-child case includes an independently written regression using the real OpenClaw monitor, client ownership runtime and Scope: protocol-fixture regression tests against main plus the two production patches, not a full build of either exact PR head or a fresh live Gateway/model test. We did not deploy these changes. Our original incident had repeated ownership refusals despite no Gateway active run, but the historical logs do not identify the retained owner, so we cannot attribute that incident conclusively to either path. I support getting this and #179099 merged. This fixes the redundant submission-protection path; #179099 covers interrupted-child protection. Testing only one would leave the other demonstrated lockout unfixed. No additional correctness finding from this validation. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…aw#177577) * fix(codex): unblock parents after native follow-up completion * test(codex): supply lifecycle timing option in custody proof --------- Co-authored-by: Peter Steinberger <[email protected]>
* fix(codex): unblock parents after native follow-up completion * test(codex): supply lifecycle timing option in custody proof --------- Co-authored-by: Peter Steinberger <[email protected]> Adapted for release/2026.10.10: rewrote the custody-test fixture and regression changes against release's older raw-notification fixture (client as never, notify instead of finishTurn/item helpers) and release's createCodexThreadLifecycleTimingTracker({ enabled: false }) options form. (cherry picked from commit b9e3c3b)
* fix(codex): unblock parents after native follow-up completion * test(codex): supply lifecycle timing option in custody proof --------- Co-authored-by: Peter Steinberger <[email protected]> Release adaptation: the stable custody test file predates main's client fixture shape; ported the new custody cases onto the stable fixture (client.client handles, explicit parent retirement on teardown). (cherry picked from commit b9e3c3b)
* fix(codex): unblock parents after native follow-up completion * test(codex): supply lifecycle timing option in custody proof --------- Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit b9e3c3b) Adapted for 2026.9.x: the product hunk keeps 9.x's guarded clearTimeout. On 9.x the submission fixture lives in native-subagent-monitor.submission-lifetime.test.ts, so the regression case and the fixture's acknowledgePredecessor/detach parameters land there, using client.notify with the existing notification builders (no item/finishTurn test-client helpers on 9.x) and the fixture's existing client handle for the runtime calls.
Related: #172837. Follow-up to #175246.
What Problem This Solves
A parent request is refused as claimed by active work after a native Codex follow-up finishes while its result still awaits acknowledgment.
User Impact
The parent can cold-resume to receive the completed result. Active child execution stays protected, and pending results and submission receipts remain available until acknowledgment.
Why This Change Was Made
After successful follow-up admission, the existing monitor owns execution protection. Release the redundant submission-owned execution hold at that handoff; retain completion custody and receipt settlement under their existing owners. No schema, configuration, or delivery-policy change is needed.
Thanks to @linancn (Nan LI) for the fix and original proof. This builds on #175246’s terminal-parent retention repair.
Evidence
397807c7374c41ffe434215e1e091edba2997474, both acknowledgment-order regressions fail atreleaseCodexBoundLiveThreadwith the terminal parent still claimed; the other 20 custody tests pass. With the fix, all 22 custody tests pass, including active-child protection, pending receipt preservation, and exactly-once consumption after acknowledgment. The 22 custody cases total 421ms of test execution; baseline wrapper time was 273.67s, dominated by preparation. The seven selected custody, retention, release-retry, delivery, submission-store, and runner suites pass: 90/90 tests across two shards, 901.05s wrapper time on this host. After integrating mainc8dfebcfaee8e8c25e9fee79304b59dd00717d8d, the affected custody file passes again (22/22; 376.91s Vitest duration, dominated by worker preparation).send_inputwith a scripted provider and held delivery acknowledgment: base rejects terminal parent resume, fixed execution protects active work then allows actualthread/resumewith a pending receipt; acknowledgment consumes once. Its binding backend is in-memory, so it does not prove disk durability.1cb15871a7f99b0f7af6346f2a04581344dd1928returnsLIVE_A_OK,LIVE_B_OK, andLIVE_NEXT_OK. No fresh authenticated Gateway/channel run was made here: the existing live lane requires provider credentials and does not inject the pending-acknowledgment interval; building a new harness exceeds the best-effort live budget.This fixes the stated follow-up lockout. Broader delivery retry and abandonment policy in #172837 remains outside this Related-only PR.
Prior inspectable redacted execution capture: real Codex pending-ack replay and live Gateway
These are excerpts from captured execution output, not expected-value examples. Only relevant fields are shown. Synthetic UUIDs are consistently aliased as
P(parent),C(child),A/B(child turns), andP_B(parent follow-up turn); local paths/endpoints are omitted. No production data or credentials were used in this replay.Runtime:
codex-cli 0.162.1, real stdio app-server and native spawn/send_input; synthetic Responses output and a deliberately held completion-delivery callback. The guard calls below are the productionreleaseCodexBoundLiveThread. This replay is distinct from the live-model Gateway smoke at the end. Receipt writes/consumption use the production binding mutation API with its existing in-memory test-store backend; this replay does not prove disk durability or restart recovery. Native app-server execution, completion notifications, unsubscribe/resume, and the separately captured native rollout files are real.Baseline —
b8f91cb249b8c702cfc02befd6d2fb11215928f3{"at":1792432690644,"event":"receipt-record","receipt":{"parentTurnId":"P_B","callId":"SEND_B","childThreadId":"C","submissionId":"B","predecessorRunId":"codex-thread:C","predecessorNativeTurnId":"A"}} {"at":1792432690681,"event":"active","claimed":false,"protected":true,"holds":{"client":2,"parent":2,"child":1},"guard":{"error":"Error: Codex thread P is claimed by active work; stop it first."},"receiptCount":1} {"method":"turn/completed","params":{"threadId":"C","turn":{"id":"B","status":"completed","items":[{"type":"agentMessage","text":"B_RESULT"}]}}} {"at":1792432690687,"event":"delivery-pending","params":{"childSessionId":"C","childSessionKey":"codex-thread:C:turn:B","result":"B_RESULT"}} {"at":1792432690886,"event":"terminal-pending-ack","claimed":false,"protected":true,"holds":{"client":1,"parent":1,"child":1},"receiptCount":1,"guard":{"error":"Error: Codex thread P is claimed by active work; stop it first."}} {"event":"result","pending":{"claimed":false,"protected":true,"holds":{"client":1,"parent":1,"child":1},"receiptCount":1,"guard":{"error":"Error: Codex thread P is claimed by active work; stop it first."}},"ack":{"receiptCount":0,"deliveryCount":1,"holds":{"client":0,"parent":0,"child":0}},"outcome":"RED"}Captured
receipt-consumecalls after releasing the acknowledgement gate: 1.Fixed source — later committed unchanged as
1cb15871a7f99b0f7af6346f2a04581344dd1928Submission-owner SHA-256:
69fea86a827910ecb12536e52b77e73a79b69b8e5454130f558a6936738acd9d(matches the committed file).{"at":1792433382642,"event":"receipt-record","receipt":{"parentTurnId":"P_B","callId":"SEND_B","childThreadId":"C","submissionId":"B","predecessorRunId":"codex-thread:C","predecessorNativeTurnId":"A"}} {"at":1792433382672,"event":"active","claimed":false,"protected":true,"holds":{"client":1,"parent":1,"child":0},"guard":{"error":"Error: Codex thread P is claimed by active work; stop it first."},"receiptCount":1} {"method":"turn/completed","params":{"threadId":"C","turn":{"id":"B","status":"completed","items":[{"type":"agentMessage","text":"B_RESULT"}]}}} {"at":1792433382677,"event":"delivery-pending","params":{"childSessionId":"C","childSessionKey":"codex-thread:C:turn:B","result":"B_RESULT"}} {"at":1792433382882,"event":"terminal-pending-ack","claimed":false,"protected":false,"holds":{"client":0,"parent":0,"child":0},"receiptCount":1,"guard":{"released":true}} {"event":"result","pending":{"claimed":false,"protected":false,"holds":{"client":0,"parent":0,"child":0},"receiptCount":1,"guard":{"released":true},"coldResume":{"threadId":"P","status":{"type":"idle"}}},"ack":{"receiptCount":0,"deliveryCount":1,"holds":{"client":0,"parent":0,"child":0}},"outcome":"GREEN"}Captured
receipt-consumecalls: 1. In the fixed run, thecoldResumefields are the actual awaitedthread/resumeresponse, obtained before releasing the acknowledgement gate.Isolated live Gateway — committed head
1cb15871a7f99b0f7af6346f2a04581344dd1928Real authenticated V1-capable model, real Codex 0.162.1 and fresh isolated Gateway state. No delivery fault injection in this healthy-flow smoke. The following fields were read back from actual Gateway terminal receipts, native lifecycle notifications and the persisted native rollout:
{ "sourceRevision": "1cb15871a7f99b0f7af6346f2a04581344dd1928", "submissionOwnerSha256": "69fea86a827910ecb12536e52b77e73a79b69b8e5454130f558a6936738acd9d", "nativeSpawn": { "parentThreadId": "P", "parentTurnId": "P_A", "receiverThreadIds": [ "C" ], "status": "completed" }, "nativeSendInput": { "parentThreadId": "P", "parentTurnId": "P_B", "callId": "SEND_B", "receiverThreadIds": [ "C" ], "status": "completed" }, "completedChildTurnIds": [ "A", "B" ], "visibleReplies": [ "LIVE_A_OK", "LIVE_B_OK", "LIVE_NEXT_OK" ], "acceptedSubmission": { "submissionId": "B", "payloadType": "custom_tool_call_output", "callId": "CODEMODE_CALL" }, "runStatuses": [ { "label": "native-spawn-A", "status": "ok" }, { "label": "native-followup-B", "status": "ok" }, { "label": "ordinary-next-request", "status": "ok" } ] }The original observer-only failure and its native-history readback correction are disclosed above; the accepted submission ID
Bmatches the same child's completed B turn. The live workload was not rerun to obtain this readback.Final validation: exact-head CI run 40145460523 passed for
707bd6daa2dc4341eaa00bf0658d291d61085edf, including both changed-extension bundles and the CI gate. ClawSweeper reviewed the same head with no findings.