Repository navigation
fix(codex): resume parent sessions after workers finish - #160608
fuller-stack-dev merged 3 commits into
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 maintainer review before merge. Reviewed September 28, 2026, 2:40 PM ET / 18:40 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Codex plugin retains worker completions for a yielded or settled parent and converts earlier durable session history during final-answer recovery. Merge readiness✅ Ready for maintainer review Current main still has both reported failure paths. The branch addresses them in the existing Codex owners, the prior request for per-file test costs is satisfied, and this review found no discrete blocking defect. Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin receives native worker notifications and tracks whether a parent session can consume them. Unconsumed results enter OpenClaw’s detached continuation path, which reads session history before resuming the parent. flowchart LR
A[Worker completion] --> B[Native receipt monitor]
C[Parent turn state] --> B
B --> D{Parent can consume?}
D -->|Yes| E[Foreground receipt]
D -->|No| F[Pending continuation]
F --> G[Verified session history]
G --> H[Resumed parent response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +43, Tests +317. Total +360 across 12 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: A yielded or settled Codex parent receives each worker result through one authorized continuation, with verified bounded history and no wake after explicit retirement. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s turn-ID-only receipt check and rejection of durable control history identify focused failing paths; the PR reports pre-fix reproductions, which this read-only review did not execute. Is this the best way to solve the issue? Yes. The patch changes receipt eligibility in the existing native monitor and uses the shared converter inside the verified history projection, without adding a second delivery owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 01c8d36b1f9a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…x-yield-continuation-20260928
…x-yield-continuation-20260928
|
Merged via squash auto-merge.
|
What Problem This Solves
Fixes Codex parent sessions stopping after their workers finish when the parent has yielded or its native turn has already ended.
User Impact
Parents retain the completion needed to resume, and recovery can read history containing earlier yield records. Active parents still avoid duplicate completion delivery, and explicit parent retirement still prevents a wake. This change requires an updated runtime; it does not replay previously failed deliveries automatically.
Why This Change Was Made
Native completion input can be queued without starting a parent turn. A receipt therefore counts as delivered only while the exact parent owner can consume it. Yielded, settled, and cancelled owners leave the result pending for the existing detached continuation path.
Recovery now converts durable custom, shell, and summary history through the shared message converter after evidence verification, while retaining content, pairing, exclusion, and size checks.
Evidence
sessions_yieldfollowed by a worker receipt before teardown lost the wake; earlier yield history rejected finalization capture for both file and SQLite sessions.After incorporating current main, all 43 affected tests passed: real Gateway completion authority, direct announcement delivery, and accepted-yield continuation. The rebase preserved the reviewed patch exactly. Live Gateway deployment is separate from this source change.
Test cost
Measured each file separately on head
fc1b7ee339260b2976cb9c35b6d267a501fd0120withnode scripts/run-vitest.mjs extensions/codex/src/app-server/<file> --maxWorkers=1. All 79 cases passed. Local wall includes startup, transforms, imports, test execution and joined cleanup; the first process starts with an empty compiler cache and later processes reuse it. CI seconds below are the sum of Vitest-reported case durations in the linked passing job, not job wall or isolated-process timing.native-subagent-monitor.terminal-receipts.test.tssettled-turn-projection.test.tssession-history-control.test.tssession-history.test.tsrun-attempt.native-followup-custody.test.tsThe extracted
session-history.test-support.tshelper has no standalone tests; both history files exercise it. The first receipt-file process spent 93% of its 91.04s Vitest phase transforming source. The actual new yield-receipt case took 1.321s locally and 2.410s in CI. The slower history and yield tests cross the real history worker, private SQLite storage, and accepted-yield lifecycle; a mocked converter or receipt predicate would bypass the original failures. No sleeps, retry increases or time-limit changes were added.Hosted CI attribution
Run
36462471023, attempt 1, reports an inherited Gateway fixture type error:session-row-projection.config-commits.test.ts:76omits the reloader scheduler required on main. The fixture and reloader blobs are identical in the tested merge, its main base and current main; this PR changes neither file. Canonical main independently repaired it in4bd105408ccdac229eee8f719f082ba143f0c26c, with passing fixture, Gateway typecheck and lint proof recorded in that commit. This PR now includes that repair through normal merges at head93dd50c5516b55dbe7c267b92c3ed93899cf85d7; #160615 adds separate fixture cleanup and is no longer a dependency. The authored 12-file patch is byte-identical to the reviewed and tested patch. The historical failure remains recorded; Current-head CI, attempt 2 passed. Attempt 1 left 143 jobs unassigned; the documented hosted-runner retry completed the remaining checks while reusing passed jobs. ClawSweeper also reviewed this exact head with no blocking findings.