fix(codex): accept a steer only when the turn consumes it - #344
Merged
Merged
Conversation
…run with Subagent items now carry optional `model` and `effort`, merged like `summary` so later lifecycle snapshots never erase them. Claude: the Agent tool's `model` alias is recorded at spawn; the resolved model and effort are read from the child's assistant records, both when they stream over stdout with `parent_tool_use_id` and when a background task's transcript is tailed (the tail hands the values back to the actor so the re-emitted spawn item keeps its live status). Codex: `spawn_agent`'s `model` / `reasoning_effort` overrides are used when present, otherwise the child inherits the parent thread's settings. The subagent row renders a `model · effort` chip next to the agent type.
The turn/steer reply only means the app-server enqueued the input, so the bubble flipped from Steering… to Steered the instant the request was sent. Codex drains pending input before its next model request and echoes it as a userMessage item; use that echo (matched by text against the acknowledged steers) as the acceptance signal instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behaviour
Codex steers showed Steered the moment `turn/steer` was sent. That reply only confirms the app-server enqueued the input; the running turn consumes it later, before its next model request. Until then the message is still Steering… in reality.
Codex core (`session/turn.rs` → `record_pending_input` → `record_user_prompt_and_emit_turn_item`) echoes the drained input back as a `userMessage` item, so that echo is the real consumption signal. The Codex client now:
The `SteerAccepted` contract doc in `agent/src/lib.rs` now describes the Codex signal alongside Claude's.
Tests
`steer_acceptance_waits_for_the_consumed_user_message_echo` replaces the RPC-reply test and protects: no acceptance on the `turn/steer` reply, no acceptance on a non-matching `userMessage` echo, exactly one acceptance across the started/completed echo pair, and no acceptance after an RPC error.
Checks run