Repository navigation
fix(codex): preserve steered turns after final replies - #184992
Conversation
Keep accepted steering alive through native completion and scope reply suppression and delivery state to the input it answers. Preserve independent terminal yields and earlier suppressed item identities. Replaces the reviewed contributor change from #180935.
Prevent an authored sibling from restoring a delivered reply's terminal authority after steering, while preserving independent explicit yields. Keep the projector result identity carrying host-issued TTS delivery provenance through finalization. Co-authored-by: Leo Stehlik <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
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. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesPreserves answers to steered Codex follow-ups after an earlier final reply while retaining independent terminal yields. Example: Codex delivers PROOF_ANSWER_A while a second question is steered into the active turn.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a current Codex follow-up delivery defect; no actionable introduced bug was found, and exact-head CI remains pending. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Codex plugin translates Gateway follow-ups into native steering, projects native assistant events, and combines delivery receipts with native completion into the final run result. flowchart TD
A[Gateway follow-up] --> B[Steering queue]
B --> C[Native Codex turn]
C --> D[Consumption notification]
D --> E[Assistant projection]
F[Tool delivery receipts] --> G[Lifecycle and finalizer]
E --> G
G --> H[Visible answer and run outcome]
Technical reviewBest possible solution: Keep steering custody, input-specific reply suppression, independent yields, and delivery accounting with their existing owners as this patch does. Do we have a high-confidence way to reproduce the issue? Current-main source exposes premature terminal release and persistent reply suppression after steering consumption, corroborated by the linked independent reproduction; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch repairs the existing owners without adding a competing execution path, and its documented native-completion tradeoff is accepted by the maintainer-authored direction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9890d705c25c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +73, Tests +296. Total +369 across 11 files. Added test files: 2. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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 Reviewed October 26, 2026, 4:39 PM ET / 20:39 UTC. |
|
Merged via squash.
|
Preserve a follow-up steered into native Codex while an earlier final reply is delivered. A steering consumption receipt records the input, not completion of its answer, so the earlier reply must not interrupt the native turn or suppress the follow-up answer. Retain submitted steering through terminal release, reset current-input suppression on confirmed consumption, preserve suppressed assistant item identities in terminal snapshots, and report current-input delivery independently of historical receipts. Independent successful yield retains its terminal authority, including nested Code Mode siblings. Non-steered final replies retain their existing behavior. Mixed final-send/authored-reply batches cannot restore discarded terminal authority after steering, while independent explicit yields remain effective. Preserve the projector result object so host-issued TTS delivery provenance survives finalization. Once steering is submitted, later final sends also finish through the existing native loop instead of the host's early-terminal optimization. No configuration, schema, dependency, or public SDK change is introduced. Replaces openclaw#180935. Related: openclaw#147759 Co-authored-by: Leo Stehlik <[email protected]>
What Problem This Solves
Fixes: a follow-up steered into native Codex while an earlier final reply is delivered can be interrupted before it receives an answer. The earlier reply's delivery state can also suppress that answer, and discarding the earlier terminal candidate can lose a successful sibling
sessions_yield.Related: #147759. This does not claim to fix #176028 or stale native-thread ownership.
User Impact
Steered follow-ups remain eligible for an answer after an earlier final reply, while a successful independent yield still ends the turn. No configuration, schema, migration, dependency, or public SDK changes are required.
Why This Change Was Made
The lifecycle controller remembers that steering was submitted even after its consumption receipt arrives. It removes the earlier final reply's terminal authority while preserving an independent terminal sibling. Confirmed consumption resets current-input reply suppression; previously suppressed item identities remain suppressed in terminal snapshots. Finalization reports the latest input's delivery state independently of historical send receipts and runtime refresh.
Once any steering is submitted, even a later final send answering that steer finishes through the existing native loop instead of the host's early-terminal optimization. Consumption confirms history admission, not completion of an answer. Explicit yield retains its existing authority. Ordinary non-steered final replies keep their existing behavior.
This incorporates main's bounded steering drain from #184062; that change handles acknowledgement-to-consumption timing but does not address the later answer, projection, and finalization gaps above. The current contributor head also preserves upstream raw-item role checks and terminal admission/drain handling.
Evidence
Independent autoreview of this integrated head remains pending. Earlier helper attempts did not produce a complete verdict and are not counted as a passing review.
837a38a625cc915ab17c9d204c8106235c5dafd1by losing the steered partial reply; the repaired candidate passed 130 tests across seven suites, followed by 38 affected tests after the final helper extraction. Inventory checks passed 32 tests. These local runs precede the contributor's latest integration.f1b1a0eca5896871578efab899e004d4d08ae886: the contributor reports 122/122 tests across seven lifecycle, steering, assistant projection, and finalization suites, with targeted typed lint, formatting, and normal commit hooks passing. Exact-head hosted CI passed, including the new test's full-suite registration,openclaw/ci-gate, and security checks: https://github.com/openclaw/openclaw/actions/runs/40311973916 and https://github.com/openclaw/openclaw/actions/runs/40313846648.PROOF_ANSWER_AandPROOF_ANSWER_B. The earlier repair delivered only A; the fixed run passed in 20.262 seconds of test execution (58.81 seconds command time).Credit: original fix, regression coverage, and Gateway investigation by @LeoStehlik.
Replacement validation
Replaces #180935; credit @LeoStehlik. The original PR cannot initialize its retained native workflow after the shared tooling state advanced beyond that workflow’s supported schema. Its binding remains untouched.
This replacement starts from current main and carries the same reviewed change: stable patch ID
6cc17a0e0c531ee402502ca66428a56c22127ded; all ten affected Codex source/test files are byte-identical to reviewed heada188d68d1d6c76619527887041800c2e8bf45fdb. The test inventory preserves main’s unrelated entry. Leo’s change is authored by Leo, followed by the existing repair commit.The historical pending-review sentence above is superseded: three complete owner-scoped independent reviews finished clean after repairs. Two additional regressions were red on the contributor head and green on the reviewed repair: mixed final/authored terminal authority and host TTS provenance. Typed lint and formatting passed. The replacement rerun passed all 58 tests with one worker per file: steering 8 (116.37s wall), media lifetime 1 (37.81s), lifecycle 46 (44.63s), and steering settlement 3 (51.62s). The unchanged Codex owner bytes retain the three completed clean autoreviews and targeted typed lint/format proof; commit hooks also formatted the carried change.
Whole change: production +73; tests/inventory +296. No new live Gateway/model round-trip; prior contributor live traces remain prior-head evidence.
Co-authored-by: Leo Stehlik [email protected]