fix(codex): preserve subagent completions after sessions_yield#105724
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 13, 2026, 4:40 AM ET / 08:40 UTC. Summary PR surface: Source +212, Tests +422. Total +634 across 4 files. Reproducibility: yes. at source and protocol-test level: the reviewed base acknowledges steering before consumption, and the focused regression models acknowledgment followed by terminal cancellation. The linked issue also provides repeated released-build reproduction with an OpenClaw-runtime control. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Integrate the consumption-confirmed steering design against current Do we have a high-confidence way to reproduce the issue? Yes at source and protocol-test level: the reviewed base acknowledges steering before consumption, and the focused regression models acknowledgment followed by terminal cancellation. The linked issue also provides repeated released-build reproduction with an OpenClaw-runtime control. Is this the best way to solve the issue? Yes, provisionally: confirming delivery from Codex's completed user-message lifecycle fixes the ownership boundary more directly than changing shared announce retries or adding configuration. Current-base integration still needs final maintainer review because the PR touches delivery and session-liveness semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d33254b7ec60. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +212, Tests +422. Total +634 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Exact-head live proof (redacted)This addresses the requested live evidence for the combined yield, interrupt, fallback, transcript, and session-liveness path. Head tested: The transient gateway was built from this exact PR head with Node 24.14.0. The live check was a temporary reporter-side probe using only Gateway RPCs ( The parent prompt used synthetic tokens and can also be pasted into any Codex-runtime session: Run A: delivery plus subsequent wakeabilityRedacted gateway timeline (local time): Independent Gateway observations from the same run: Probe output: Run B: live yielded lifecycle metadataA second exact-head run captured the Gateway lifecycle-end frame itself (IDs and timestamps redacted here): {
"phase": "end",
"aborted": false,
"yielded": true,
"livenessState": "paused",
"stopReason": "end_turn"
}The same run then observed Together, these observations show the requested chain on this exact head: the child completes; the unsafe old-turn wake is rejected; terminal yield releases the turn; OpenClaw starts the native requester-agent fallback; the child result appears once in the parent transcript; the yielded lifecycle is paused; and that parent accepts a later turn. For the maintainer-friendly, credential-free bug reproducer, the PR's four-second in-repo Vitest remains the primary proof. It deterministically demonstrates the underlying accepted-but-unconsumed steer being cancelled by terminal release. The live output above validates that the same ownership boundary produces the intended end-to-end behavior with a real Codex runtime. I also rechecked the dependency contract directly at OpenAI Codex commit @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@Solvely-Colin please let me know if you need more from me. I am new to this particular review workflow. |
da3d455 to
6a7b10a
Compare
714b340 to
278a0aa
Compare
Co-authored-by: Alexis Gallagher <[email protected]>
278a0aa to
5093e8a
Compare
|
Merged via squash.
|
…law#105724) * fix(codex): preserve subagent completions across sessions_yield * fix(codex): confirm steering delivery before yield Co-authored-by: Alexis Gallagher <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #104806
What Problem This Solves
Fixes a P0 message-loss race in the Codex runtime. A parent could accept a subagent completion steer, call
sessions_yield, interrupt the turn, and lose that accepted input before Codex consumed it.Why This Change Was Made
Codex distinguishes RPC acceptance from transcript consumption.
turn/steeraccepts input into the active turn queue;turn/interruptclears pending input. The durable consumption signal is the matching completeduserMessageitem.This revision keeps each steer pending under an exact
clientUserMessageIduntil Codex emitsitem/completedfor the matchinguserMessage.clientId. A successful terminal yield cancels unconsumed steering before interrupt, allowing the existing completion fallback to retry on a fresh parent turn. A failed or non-terminal yield leaves steering usable. Run abort closes the queue immediately, so no accepted-but-unconsumed wake can hang through cleanup.The implementation replaces the earlier FIFO inference with one canonical identity-based path. No config, migration, or shared announce-routing change.
Upstream Codex contract checked at
1d941253e9354fe583a033660a6288df66e27488:turn/steeracceptsclientUserMessageIdUser Impact
Codex-backed orchestrators no longer falsely report a yielded subagent completion as delivered into an interrupted turn. The result reaches the parent exactly once through the normal retry path, and the parent session remains usable.
Evidence
Exact candidate:
5093e8aef1530af1971aa524c85e091f0c3ea8e3278a0aa20496b0af6294153864703f32fef91fba: real Gateway, forced Codex runtime, realsessions_spawn, successfulsessions_yield, child completion in the parent transcript exactly once, and a successful second turn in the same session; 224 seconds including the production build. The final rebase changed only the main parent;git patch-id --stableremained786317cb39b7e49361ce5a5d222b076037b1b116.Release-note context: Fix Codex subagent completion delivery after
sessions_yield. Thanks @algal.AI-assisted: investigated, rewritten, tested, and drafted with agentic tools. Maintainer reviewed the dependency contract, behavior, proof, and final diff.