Repository navigation
fix(codex): restore child tasks after native parent rotation - #159735
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: blocked before merge. Reviewed September 27, 2026, 11:46 AM ET / 15:46 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Codex plugin prepares fresh task records before restoring or admitting native child tasks, and adds recovery and closure regression coverage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 2 items remain Current main still uses the task reader implicated in saved-child recovery after parent rotation. The merged database-contention work is related, but does not cover this distinct failure. No discrete introduced correctness defect was established. Priority: P1 Review scores
Verification
How this fits togetherCodex reports native child-thread events to OpenClaw's plugin. The plugin matches those events to saved task records and controls which child assignments and results appear in OpenClaw. flowchart LR
A[Codex child events] --> B[Native task monitor]
C[Saved task records] --> D[Prepared task read]
D --> B
B --> E{Parent and child current?}
E -->|Yes| F[Task assignment and result]
E -->|No| G[Refuse admission]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +617, Tests +342. Total +959 across 15 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep fresh task reads and child-admission checks with the existing task persistence owner, preserving exact assignment and completion custody through parent rotation. Do we have a high-confidence way to reproduce the issue? Yes. The current-main reader path and the supplied core regression give a high-confidence sequence: publish a concurrent task change, rotate the parent, then observe a native child resume. This read-only review did not execute it. Is this the best way to solve the issue? Yes. Preparing current records through the existing task runtime is a narrow owner-level repair, and the added cases exercise both recovery and close-during-read refusal. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5c3cb0a11b9b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
Integrate canonical main at 77847 and the canonical rotated-parent recovery repair from #159735. Preserve current managed creation/backing checks and the actual SQLite transaction owner while retaining worker cancellation dispatch, commit admission, and test routing. Remove the obsolete, unused lifecycle option retired by #157413. The composed candidate passes 546 selected cases, current type graphs and review through P2; exact-head CI remains the landing gate.
Related: #159325
What Problem This Solves
Fixes saved Codex child-task recovery failing when task records change while a native parent resumes.
User Impact
Resumed parents recover their original child assignments and accepted follow-ups. Closing a child during preparation revokes its pending admission before it can acquire authority. No operator action is required.
Why This Change Was Made
A registration-time task reader can require fresh preparation after concurrent publication. Native admission now consumes a current reader through its existing persistence owner while retaining the original source, parent, receiver, and receipt custody. Initial task creation is queued before retirement can observe the child; cold receipt restoration joins its initial reconciliation, while warm observation remains independent of notification completion.
The synchronous direct-spawn path uses a guarded resident reader only when that capability is current. Stale reads use asynchronous preparation. Existing task guards, public SDK contracts, schemas, and retention rules are unchanged.
Evidence
The same feature bytes also passed a separate composition check on main
a67c5aac(including the worker-ownership replacement): the causal core case plus all 21 rotated-parent and cold-recovery cases passed with no unhandled errors. The relevant task projection contracts and dependency graph were checked explicitly.Measured with the maintained two-worker lanes: the real SQLite rotated-parent file took 27.82s (24.88s test time), and the moved receipt-ownership file took 2.80s (0.06s test time). The core custody file passed in 33.52s; it retains the registered harness-to-worker/storage boundary needed to prove ownership and publication ordering. The focused causal case took 2.34s.