Repository navigation
fix(codex): resume stopped parents while native children continue - #172145
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 changesThis PR makes stopped Codex parents reusable after confirmed native interruption while retaining subscriptions for their running children. Example: Parent thread-1 stops while child-thread continues working.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep open: current main still exposes the stopped-parent claim failure, and this PR provides a focused repair with no concrete introduced code defect found. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Codex plugin translates Gateway attempts into native App Server turns; its lifecycle and subscription owners coordinate interruption, session authority, retained thread custody, and child-result delivery. flowchart TD
A[Gateway conversation] --> B[Codex attempt]
B --> C[Native parent turn]
C --> D[Native child work]
C --> E[Exact interruption receipt]
E --> F[Subscription owner]
D --> F
F --> G[Parent continuation]
Technical reviewBest possible solution: Keep continuation in the existing subscription owner, requiring exact native interruption confirmation and current original-source, lineage, binding, and claim authority. Do we have a high-confidence way to reproduce the issue? Current-main retention and protected-claim release establish the failure mechanism, consistent with the reporter's released-version logs; no current-main native end-to-end reproduction was run. Is this the best way to solve the issue? The patch repairs the existing lifecycle and subscription owners, preserves incognito permission-restart behavior, and strengthens lineage checks without adding another recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d388ca43e08a. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No reachable authorization bypass was found, but the retained-source handoff still needs final-effect verification. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +18, Tests +357, Docs +7. Total +382 across 11 files. Added test files: 1. 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 (3 earlier review cycles)Reviewed October 15, 2026, 3:21 AM ET / 07:21 UTC (Revision 4). |
Keep the exact-interruption custody repair, simplify its cleanup predicate, and share native-child fixtures across stop and yield. Check original-session completion delivery, duplicate terminal events, and stale interruption receipts. Document continuation while native children remain active. Original fix by @Baumus; confirmed-interruption approach from @VishalJ99. PR CI owns tests and typechecks; live proof intentionally skipped per maintainer policy. Related: openclaw#171140. Co-authored-by: Baumus <[email protected]> Co-authored-by: Vishal Jain <[email protected]>
Apply confirmed-interruption child retention only to ordinary parents so incognito permission changes keep their existing reusable subscription. Update the active-background custody oracle to reject replaced lineage and assert that no reusable subscription is published, even with live processes. CI exposed the incognito regression and the old lineage-bypassing expectation. The existing permission-change table covers the regression; no new test cases or local execution were added. PR CI remains the proof gate.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…enclaw#172145) * fix(codex): resume stopped parents while native children continue * fix(codex): retain newly admitted native work without replaying publication * fix(codex): tighten stopped-parent continuation coverage Keep the exact-interruption custody repair, simplify its cleanup predicate, and share native-child fixtures across stop and yield. Check original-session completion delivery, duplicate terminal events, and stale interruption receipts. Document continuation while native children remain active. Original fix by @Baumus; confirmed-interruption approach from @VishalJ99. PR CI owns tests and typechecks; live proof intentionally skipped per maintainer policy. Related: openclaw#171140. Co-authored-by: Baumus <[email protected]> Co-authored-by: Vishal Jain <[email protected]> * fix(codex): preserve incognito permission restart custody Apply confirmed-interruption child retention only to ordinary parents so incognito permission changes keep their existing reusable subscription. Update the active-background custody oracle to reject replaced lineage and assert that no reusable subscription is published, even with live processes. CI exposed the incognito regression and the old lineage-bypassing expectation. The existing permission-change table covers the regression; no new test cases or local execution were added. PR CI remains the proof gate. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vishal Jain <[email protected]> Co-authored-by: Baumus <[email protected]>
Adapt #172145 (66e67a0) to release/2026.11.4. Preserve the six later release cleanup and ownership fixes. Exact-turn interruption joins before subscription transfer; retention remains bound to the original live source and lineage. Fresh independent review clean on exact patch 3fd03c04dc29c0feb7a92cf5bf51e715ba26828d3fe8436d9496e12288650455. Real cold-parent negative control reproduced unwanted unsubscribe; 125 focused tests across 8 files passed, with scoped types, lint, format and docs checks. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Fixes #171140.
Related approach: #171110 by @VishalJ99 (still an open draft; leave it open until this PR merges).
What Problem This Solves
Stopping or yielding a Codex parent while native children continue can leave the parent claimed, rejecting follow-up messages and child-result continuations as active elsewhere.
User Impact
The original conversation can accept another message after Codex confirms the exact parent turn has ended, while its native children remain observable. Child results retain their original session lineage and once-only delivery. No settings, schema changes, or migration are required.
Why This Change Was Made
Keep the existing subscription owner and distinguish child subscription custody from foreground turn authority. Cleanup joins the exact native interruption before retaining the parent. Publication checks the current source, initiating session lineage, physical client, binding, and claim; replaced sessions and revoked sources cannot inherit it. Native work arriving during foreground admission can use one fresh cleanup admission, and an already-started publication is never replayed.
Fresh main includes #172287 (
73c9e39c619a): failed-thread recovery still owns coordinated teardown and configuration refresh. This repair uses its existing thread/subscription lifecycle, without creating another recovery path. Source/history confirm that main's settled-turn-only retention and protected warm-claim release still produce the reported blockage.Original fix by @Baumus; maintainer cleanup removes a redundant retention predicate and duplicate pre-turn release, shares stop/yield fixtures, strengthens original-session/duplicate-completion and stale-turn assertions, and documents continuation. CI follow-up preserves incognito permission-change retention and rejects stale-lineage publication even when an original background process remains active. The confirmed-interruption approach comes from @VishalJ99; both contributors are credited in the commit.
Evidence
Final head
446b811446b16cd92194d4ed8b1b588a4b736463: CI run 38695728145 passed (42 jobs, 28 intentional skips). All 61 applicable PR checks pass, with no failures or pending checks. Production/test typechecks, typed lint, docs, and both changed-extension test bundles passed.PR CI is the test and typecheck gate per maintainer policy. Live Gateway proof, leases, local tests/typechecks, and production-revert negative controls were intentionally skipped. No contributor code was executed on the maintainer host; local checks were static only.
Regression coverage for CI:
continues an interrupted parent and delivers its child's result (warm: %s): cold/warm continuation, original session destination, and duplicate completion suppression.does not publish an interrupted parent after its %s is replaced: binding and session-lineage replacement.settles a yielded parent under retained source authority (revoked: %s): closed foreground with valid/revoked original source.keeps native yield cleanup alive after its subscription route is released: interrupt acknowledgment, unrelated/stale completion, and exact native terminal receipt.recovers subscription custody when row admission fails %s: arriving native custody and no replay after publication.rechecks %s background custody at subscription retentiontables: preserve permission restarts and forbid stale-lineage reusable custody. The active-process row previously expected successful publication after lineage replacement; this source-verified oracle is corrected to require rejection and no reusable subscription. Peer processes retain cleanup-only protection.Static checks: formatting and
git diff --checkpass. Changed-file core oxlint reports only the existingrun-attempt-resources.tsmax-lines limit: both main and this head are 707 counted lines (limit 700); other diagnostics are clean. Tools ran from clean trusted main against copied changed files. The shared install lacks the UI-only Solid lint plugin, so the static config omits only its unmatchedui/**/*.tsxoverride; all applicable rules remain enabled. No dependencies were installed.Autoreview: isolated Codex P0-P2 branch review is scoped-clean, with no accepted/actionable findings. Fresh isolated review also covers follow-up commit
ac26244daeed; it found no actionable P0-P2 findings, including in the incognito correction and strengthened lineage oracle. The subsequent main merges have no overlapping changes in this owner. The first CI run passed all six parent cases and all production/test typechecks. It exposed an incognito restart regression and the stale-lineage oracle described above; both are repaired in the follow-up. Its unrelated UI lint failure was fixed upstream bye1dbb5644873and is included by the subsequent main merge. The final CI run passes both repaired cases, including the incognito restart and active-background stale-lineage rejection. No workflow reruns were needed; the second run follows the code correction and required main merge.Test cost: six table-driven parent cases, one additional subscription-admission variant, and assertions in an existing lifecycle case; no new CI job, real sleeps, polling, or live-model dependency. The parent file shrank from 334 to 317 lines. LOC versus merged main: production +61/-43 (net +18), tests +419/-63 (net +356), docs +7/-0, test routing +1/-0. The necessary production growth records native confirmation and preserves source/lineage checks; no unrelated deletion was used to meet a line target. Maintainer cleanup reduces the contributor delta by 15 total lines. Local wall times are not measured by policy. Final-head CI measured the six parent cases at 4.960s, 0.618s, 0.318s, 0.327s, 3.913s, and 0.707s (10.843s total test time), all passing. The active-background lineage case passed in 0.807s and the incognito permission-restart case in 4.591s. Final extension test job.
ClawSweeper's complete latest review reports no concrete code findings. Its remaining requests concern live native-boundary/final-effect proof; PR CI is the proof per maintainer policy. The authority checks and rejection regressions remain in scope.
Native source and deferred-effect checks
Personally inspected the read-only native Codex checkout at
be2951ea34f0d295ed0becf97079f92fa5f6950e:TurnAborted.turn/completednotification; the response alone is insufficient.sessions_yieldis OpenClaw's dynamic turn-control contract, not a native Codex tool; OpenClaw must join interruption before subscription transfer.Captured facts at deferred retention:
withCurrent/assertCurrent; child completion retains its captured history owner and source custody.