Repository navigation
fix: steering misses the next tool boundary after ACK - #120964
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
f7256cf to
49d728f
Compare
|
Codex review: found issues before merge. Reviewed August 9, 2026, 5:57 AM ET / 09:57 UTC. ClawSweeper reviewWhat this changesThe PR makes steering acknowledgements wait for runtime acceptance and adds terminal fencing across Gateway, embedded, Codex, and chat UI paths. Merge readiness⛔ Blocked by patch quality or review findings - 8 items remain Keep open. The prior Copilot and reply-target ownership blockers remain, and terminal Codex cancellation introduces an ordering race that can reject an already-completed steer. Priority: P1 Review scores
Verification
How this fits togetherA chat steer passes from the UI through Gateway admission into an active runtime queue. The runtime must record ownership before Gateway acknowledges it, while terminal events must not let a successor run inherit or erase that message. flowchart LR
A[Chat composer] --> B[Gateway admission]
B --> C[Active-run registry]
C --> D[Embedded, Copilot, or Codex runtime]
D --> E[Runtime ownership]
E --> F[Gateway acknowledgement]
F --> G[Steering badge]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +96, Tests +450. Total +546 across 26 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make every runtime report acceptance at its actual queue boundary, start reply-target injection before a started acknowledgement, and retain already-dispatched Codex batches until serialized completion handlers can confirm them. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold Copilot transcript receipt after session.send, send a reply-targeted steer, or delay a Codex item-completed handler before terminal receipt; each exposes a remaining ownership race. Is this the best way to solve the issue? No. Waiting for acceptance is the right owner boundary, but the implementation omits Copilot and reply-target paths and cancels dispatched Codex work before serialized confirmation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 917fd92686c5. 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)
|
49d728f to
89bad62
Compare
|
Land-ready proof for final exact head
Focused proof already run and recorded on this PR: Those eight Vitest shards passed 620/620 tests, including all three P1 regressions and five real Gateway E2Es. The manifest-only patch-equivalence smoke passed 202/202, the Plugin SDK API baseline check passed, targeted formatting/oxlint/diff checks passed, and final autoreview had no accepted or actionable findings. |
26b3bdc to
5a96043
Compare
5a96043 to
7b92010
Compare
|
Merged via squash.
|
* fix(steering): wait for queue acceptance before ack * fix(steering): preserve session steer call contract * fix(steering): close runtime ownership gaps * fix(ci): refresh plugin SDK API baseline
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users steering during an active tool call could see duplicate Steering badges and then
active run changed; review and retry. Even after thestartedACK, the unstarted sequential tail could execute before the message entered runtime ownership.Why This Change Was Made
The Gateway now waits for queue acceptance—not transcript completion—before ACK. Exact-run anti-ABA remains; stale exact targets fall back FIFO without steering successors; embedded and Codex runtimes report and fence ownership; Codex terminal turns cancel pending bound steering; and the UI renders one badge while preserving
replyToId.User Impact
After
started, the steer is owned and appears at the earliest safe boundary after a running tool. The unstarted tail skips, there is no successor misdelivery, and the UI shows one Steering badge.Release note context: Steering now waits for runtime queue acceptance before acknowledging, preventing messages from missing the next safe tool boundary.
Evidence
af73dbcc834027e84d8717e17c504020a17e567a. The cumulative PR diff remains 30 files and +1307/-402 total: production +349/-201 (net +148), tests +926/-169 (net +757), and generated +32/-32 (net 0).docs/.generated/plugin-sdk-api-baseline.sha256was regenerated withpnpm plugin-sdk:api:gen; the API check passes. The reviewed ten-file P1 repair did not alter that baseline.session.sendsucceeds or a pending question is claimed; reply-targeted exact steering hydrates and accepts before the ACK while ordinary replies remain post-ACK; and Codex terminal receipt seals unsent admission while serialized terminal cancellation preserves correlation for an earlier consumed dispatch.pnpm plugin-sdk:api:checkpassed on the final head. The three source commits retain identical stable patch IDs across the rebase (9e5b1cc499db68bb8c29228b61f66018f493f87b,0ce0dc46168cd931f7b3f753b18df9a4bb037dfa, and437208cdbf48dbc04afa5ca80efe5acf64060364); only the isolated generated-manifest commit was regenerated for the new base.oxfmt --check), oxlint, andgit diff --checkpassed for the ten-file repair;pnpm plugin-sdk:api:checkconfirmed the existing generated API baseline.turn/steercontract, atomic active-turn mailbox admission,clientUserMessageIdcorrelation on user-message notifications, and ordered item/turn notification emission (codex-rs/app-server-protocol/src/protocol/v2/turn.rs:175,codex-rs/app-server/src/request_processors/turn_processor.rs:910,codex-rs/core/src/session/mod.rs:4022,codex-rs/app-server/src/bespoke_event_handling.rs:187, andcodex-rs/app-server/src/bespoke_event_handling.rs:1020).ask_usercall-shape assertions; the redundant positional callback was removed, established steer call shapes were restored, and all 30/30ask_usertests passed without changing their expectations.