Repository navigation
fix(codex): completed grandchildren replay after Gateway restarts - #179050
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 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: needs real behavior proof before merge. What this changesThis PR retires completed native Codex grandchildren through the existing assignment owner without sending another root continuation. Example: parent-thread spawns child-thread, which spawns grandchild; grandchild finishes grandchild-turn.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-authored PR addresses a confirmed recovery defect still present on main; the prior cancellation-test finding is fixed, and no new concrete code defect was found. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Codex plugin monitor receives native completion events and recovered thread history, then settles saved assignments through the requester-bound binding store. flowchart TD
A[Codex native completion] --> B[Completion monitor]
B --> C[Native lineage recovery]
C --> D[Requester and custody checks]
D --> E[Existing binding mutation owner]
E --> F[Persisted assignment retirement]
Technical reviewBest possible solution: Retire only lineage-proven completed grandchildren through the existing requester-bound assignment owner, preserving rotated-root follow-ups and uncertain recovery. Do we have a high-confidence way to reproduce the issue? Current main shows the mismatched native parent rejecting the completion claim, settlement preserving the pending assignment, and registration restoring it; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch uses the appropriate existing owners and distinguishes native lineage from root rotation; the simplification and test-value review found no unnecessary machinery or duplicate test group. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ef6d500b5340. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete authorization bypass was found, but the new retirement admission still needs final-effect authority proof. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +60, Tests +132, Docs +6. Total +198 across 7 files. Added test files: 0. View PR surface stats
Review metrics
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 HistoryReview history (1 earlier review cycle)
Reviewed October 21, 2026, 2:00 AM ET / 06:00 UTC (Revision 2). |
|
The P2 consumer regression is fixed in 6f7be88: the Stop test now expects the shared acknowledgement diagnostic, while retaining rejected-write, reopen, and successful-retry assertions. The follow-up branch autoreview is clean through P2. The first CI run passed all four new grandchild cases and the extended rotated-root case; fresh exact-head CI will verify the correction. Per explicit maintainer policy for this repair, PR CI is the test/proof gate. Live Gateway, released-state upgrade, and production-only negative-control runs are intentionally skipped. I am declining the proof-only requests under that policy. The review found no concrete authorization bypass: the nested path verifies native lineage and rechecks child custody, requester identity, and the existing binding owner's authority before consumption. There is no schema or stored-format change; restored existing assignments are covered by the regression cases. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…enclaw#179050) * fix(codex): retire completed grandchildren without restart replay * test(codex): align native assignment acknowledgement expectation
…79050) * fix(codex): retire completed grandchildren without restart replay * test(codex): align native assignment acknowledgement expectation Adapted for release/2026.10.10: the cancelled-child acknowledge call keeps release's assertChild guard (main passes assertChildCustody), and #173018's give-up retirement tests move from native-subagent-inventory.test.ts into native-subagent-inventory.retirement.test.ts so the combined release file stays under the max-lines limit; the grandchild tests send raw notifications because release's test client lacks the item/completeTurn helpers. (cherry picked from commit b189a9f)
…79050) * fix(codex): retire completed grandchildren without restart replay * test(codex): align native assignment acknowledgement expectation Release adaptation: stable has no Stop-driven descendant cancellation (#169700 is main-only), so the inventory gains the generic acknowledge() owner directly instead of renaming settleCancelled, and the main-only cancellationRequested guard and withDescendantCancellation hunks were dropped. The monitor keeps its stable thread-status-revision readHistory wrapper. Tests use client.notify with existing notification builders instead of the main-only client.item/completeTurn helpers and drop listPendingChildren probes. (cherry picked from commit b189a9f)
…79050) * fix(codex): retire completed grandchildren without restart replay * test(codex): align native assignment acknowledgement expectation (cherry picked from commit b189a9f) Adapted for 2026.9.x: 9.x has no descendant-cancellation (Stop) path, so there is no settleCancelled to rename; acknowledge() is added as a new method and the cancellation hunks plus the Stop submission-store test expectation are dropped. 9.x CodexNativeSubagentHistoryRecovery does not hold knownChildren, so the monitor checks its own knownChildren before asking history recovery to read the middle thread. Tests use client.notify with the existing notification builders because the 9.x test client has no item/completeTurn helpers, and listPendingChildren assertions are dropped (no such 9.x API).
The #173018/#179050/#179099 ports awaited inventory and submission-store reads that are synchronous on 9.x (await-thenable), and grew native-subagent-inventory.test.ts past the 1000-line limit. Drop those awaits and move the delivery/restoration cases into native-subagent-inventory.restoration.test.ts.
Fixes #178395
What Problem This Solves
Fixes completed Codex grandchildren leaving saved assignments that are restored and rejected again after every Gateway restart.
User Impact
Nested native work settles without repeated ownership warnings, stale assignments, or an extra result sent to the root requester. Existing pending assignments recover on registration when native lineage is available. Rotated-root follow-ups and uncertain recovery remain pending; no configuration or stored-format migration is required.
Why This Change Was Made
Codex delivers a grandchild's result to its immediate native parent, while OpenClaw's saved locator belongs to the root requester. Treating those two identities as the same delivery destination rejected valid nested completions. The assignment inventory now acknowledges lineage-proven nested completion through its existing durable consumption owner, checking current child custody and requester identity at the write. Recovery reads the middle thread's metadata when that child is no longer in memory.
The simplification pass reuses cancellation acknowledgement and avoids duplicate consumption after it commits. Production growth is +60 lines (+66/-6): the added lineage recovery and authority checks have no existing equivalent to reuse safely. Tests are +133/-1 lines (net +132); documentation is +6/-0.
Evidence
e8d8145cd62feac71d6c65636c948a74b7f799d6. Codex's native spawn and immediate-parent completion watcher were inspected directly.acknowledges a grandchild's native completion without root delivery or restart replayandsettles a restored grandchild only with native lineage and current custody(available, unavailable, and revoked cases). Extendedadmits a fresh follow-up after native parent rotation only with current matching custodythrough undelivered completion.git diff --checkpassed.The first CI run (39549070462) passed 28 jobs, including all new grandchild and extended rotation cases. Its only failing test expected the previous cancellation-specific acknowledgement error; the sibling Stop recovery assertion now expects the shared acknowledgement diagnostic, with all recovery/retry checks preserved. Corrected head
9497bbf2600cd45a19c95e0974186d6b0f897304includes a fresh merge of main855b0aa7242e31c85051d20db54a853025cd4094and passed exact-head CI 39551224201: 29 successful jobs and 28 intentional skips, including the corrected Stop consumer and the grandchild regressions.ClawSweeper's P2 cancellation-test finding is addressed by the diagnostic expectation correction. Its remaining asks concern extra live/durable-state proof; those are intentionally declined under the explicit maintainer policy above. The review found no concrete authorization bypass.