Repository navigation
fix(codex): preserve steered turns after final replies - #180935
LeoStehlik wants to merge 5 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: blocked before merge. What this changesPreserves submitted Codex follow-ups, restores their answer visibility, and retains independent terminal yields after an earlier final reply. Example: A delivers PROOF_ANSWER_A while B is submitted through the Gateway.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a remaining Codex follow-up delivery defect that the merged consumption-drain repair does not solve; no actionable introduced defect was found, but the completion-policy tradeoff needs an owner decision. Priority: P1 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Codex plugin translates active-run follow-ups into native steering and converts native notifications and tool-delivery receipts into visible answers and terminal run outcomes. 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: Preserve follow-up delivery through the existing queue, projector, and finalizer owners with an explicit decision on native completion after steered final sends. Do we have a high-confidence way to reproduce the issue? Current-main source shows terminal release can finish after consumption without answering the steer, while its unchanged final-reply flag suppresses later assistant output; the discussion independently corroborates both receipt orderings. Is this the best way to solve the issue? The patch repairs the existing owners without adding configuration, persistence, or a competing execution path, but its broader final-send completion policy requires owner acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6af393748075. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +69, Tests +245. Total +314 across 11 files. Added test files: 2. View PR surface stats
LabelsLabel changes: No label 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 HistoryReview history (3 earlier review cycles)
Reviewed October 26, 2026, 7:10 AM ET / 11:10 UTC (Revision 4). |
|
@clawsweeper re-review Repair head: 8f47d92. Both reported mechanisms have red/green regressions; the body now includes actual isolated Gateway/native Codex/real-model QA HTTP evidence delivering A then B, plus the normal-finalizer propagation repair exposed by that test. Explicit remaining proof limit: both receipt/release-check orderings and direct/nested final-send-plus-yield orders have deterministic regression coverage. Two extra live yield-control attempts omitted the requested yield call, so we do not claim live successful-yield proof. Please assess the updated repair and evidence with that limit. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Fixed revision 2 test-suite ownership finding in ddf42e3: one inventory entry beside the existing lifecycle controller. Exact CI assertion reproduced red; all32 configuration tests and6 steering tests in the assigned worker lane pass locally. No production changes after the Gateway-proven8f47d927 repair. Required PR-body headings restored; context check passed before this push. The upstream lifecycle-owner decision on native completion remains open and is explicitly recorded in the body. No owner acceptance or live successful-yield proof is claimed. |
|
🦞👀 Re-review progress:
|
|
Independent source-level reproduction on main These cases overlap this PR, so no duplicate PR was prepared. The reproduction's formatting, targeted lint and targeted type checks pass. This exercises the production queue and lifecycle with an in-memory transport, not Gateway E2E. The PR was inspected read-only; the author's live proof was not independently rerun. In particular, I have not independently verified this PR's fix or the live final-send-plus-yield combination. The reproduction and review were prepared with AI assistance. |
|
@clawsweeper re-review Conflicts resolved at f1b1a0e. Updated PR evidence records 122 passing focused tests, static gates, independent source review, and the limits of prior-head live proof. |
|
🦞👀 Re-review progress:
|
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]>
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 #180935. Related: #147759 Co-authored-by: Leo Stehlik <[email protected]>
|
Thank you @LeoStehlik for the fix, regression coverage, and Gateway investigation. Your work and authorship were carried forward into #184992, which is now merged. Closing this superseded PR. |
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.
Co-authored-by: Leo Stehlik [email protected]