Repository navigation
deliver: retry a steer the runtime refuses because the turn just ended - #58
Merged
Merged
Conversation
`Session.deliver` retried a steer only when the adapter's own gate answered
`no_active_turn`. Past the gate the runtime can refuse in its own words: a
codex `turn/steer` that reaches the app-server after the turn completed is
answered `{"code":-32600,"message":"no active turn to steer"}` (probed live
on codex-cli 0.158.0), which the codex adapter records as `runtime_refused`.
`deliver` then returned `rejected` while the session was already idle,
although the spec says the steer-vs-turn-end race is retried.
`deliver` now also retries when the session's status shows the turn it
steered into is over (idle, or a different turn). The regression test
scripts that ordering on the fake codex app-server and fails without the fix.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 2, 2026
Patch release with two fixes merged today: - #58 `Session.deliver` prompts a new turn when the runtime itself refuses a steer because the turn just ended (codex answers `no active turn to steer` after the adapter's gate passed); before, `deliver` returned `rejected: runtime_refused` with the session already idle. Found by the daily inspection. - #59 Installation probes and the codex app-server keep native failure diagnostics: exit code, signal, timeout or spawn error, and the last 8 KiB of stderr in the thrown error's message and cause (record shapes unchanged); a failed spawn no longer leaves an unhandled rejection that could end the host. Windows codex CI forwards stderr. Refs #57. Version bump only in this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Found in a daily inspection (#inspection).
Problem
docs/spec/conversation.mdsaysSession.deliverretries a steer that is refused because the turn just ended.deliver.tsonly retried on the adapter gate'sno_active_turn. A steer that passes the gate and reaches the runtime after the turn ended is refused by the runtime itself:turn/steerwith theexpectedTurnIdof a completed turn answers{"error":{"code":-32600,"message":"no active turn to steer"}};turn/steerRPC error toruntime_refused(steerPlaninruntimes/codex/session.ts, as documented indocs/runtimes/codex.md).So on codex,
deliver(input)during the last moments of a turn returned{ landed: "rejected", code: "runtime_refused" }with the session already idle, instead of prompting a new turn. A subagent report delivered as the parent's turn ends is the typical case.Fix
deliveralso retries when the status shows the steered turn is over (idle, or a different turn since the steer was sent). No contract shape changes; the spec sentence now names this case.Not done here, for review to decide: mapping codex's "no active turn to steer" to
no_active_turnin the adapter. That would make the typed code honest for every consumer, but it means matching an error message, anddocs/runtimes/codex.mdcurrently documents every RPC error asruntime_refused.Evidence
tests/codex/codex-session-stream.test.ts: the fake app-server writesturn/completedand then that error in reply to the steer. It fails onmain(landed: "rejected") and passes here.oar run codex) was given only the claim and the evidence above and asked to refute it; verdict NOT REFUTED (the gate is read before the RPC, and the reply is processed in wire order).pnpm run check: 461 tests passed, sea trial mock 18/18.🤖 Generated with Claude Code