Skip to content

codex: a steer codex drops on interrupt stays in pendingInputs forever (nothing says it was dropped) #236

Closed

Description

@xxchan

What happens

Ferry, a real Codex session (owner, 2026-10-08). A person steers a message into a running codex turn. Codex takes a steer only when its current step ends, so the steer waits in SessionView.pendingInputs, which Ferry shows above the composer as "Waiting for Codex to read". The person then stops the turn. The turn ends aborted and the session goes idle. The steer stays in pendingInputs for as long as the process lives. Codex never reads it, no record says it was dropped, and later turns don't read it either. A host following docs/design/chat-ui.md ("a tray above the composer until the runtime takes the input") shows "waiting" forever, with nothing it can do.

Why: codex drops it, and says nothing

From openai/codex at ea27864 (main, 2026-10-08):

  • turn/interrupt → Session::abort_all_tasks (tasks/mod.rs#L549-L576) first takes the active turn out of the session (take_active_turn, #L893-L905). It then calls input_queue.clear_pending(&active_turn), which clears pending_input.items (session/input_queue.rs#L315-L320). finish_turn_abort does the same (#L624).
  • on_task_finished is the path that would record the turn's pending input as a userMessage item (the echo oar maps to user_message; #L662-L697 → record_pending_input). After an interrupt it finds no active turn and returns early. So by turn/completed, a steer has either been echoed or dropped: echoed when the turn ends by itself, dropped when it was interrupted.
  • Codex's own TUI relies on this (tui/src/chatwidget/input_restore.rs#L340-L342): "The server has already discarded pending input by the time the interrupted turn reaches the UI, so any unacknowledged steers still tracked here must be restored locally instead of waiting for a later commit." On Esc it puts them back in the composer, or resubmits them when the interrupt was made to send them.

oar's codex adapter maps turn/completed {status: "interrupted"} to turn_ended {aborted} and nothing else. The view rule in docs/spec/conversation.md, "An input never echoed stays pending, even after its turn ends", then keeps the steer pending. That rule fits an input the runtime still holds (claude: "Input arriving after the last step becomes a subsequent turn"). It does not fit one the runtime has thrown away.

Repro (oar 0.39.0; observe/ and the codex projection are unchanged on main 97170d4)

These are the records the codex adapter writes for this case:

import { createSessionKernel } from "@botiverse/oar/kernel";
import { viewOf } from "@botiverse/oar/observe";

const k = createSessionKernel("thread-1");
const at = { spanId: "turn-1" };
await k.control({ kind: "prompt", input: "run the slow check", inputId: "in-1" },
  () => ({ kind: "accepted", native: { turn: { id: "turn-1" } } }));
k.frame({ type: "item/started", native: {}, events: [
  { kind: "user_message", input: "run the slow check", inputId: "in-1", evidence: "turn_item" }] }, at);
k.frame({ type: "item/started", native: {}, events: [
  { kind: "tool_call_started", callId: "cmd-1", tool: "commandExecution" }] }, at);
// turn/steer while the command runs: codex holds it until the step ends.
await k.control({ kind: "steer", input: "also check the tests", inputId: "in-2" },
  () => ({ kind: "accepted", native: { turnId: "turn-1" } }));
// turn/interrupt, then turn/completed {status: "interrupted"}: codex has dropped the steer.
await k.control({ kind: "abort" }, () => ({ kind: "accepted", native: {} }));
k.frame({ type: "turn/completed", native: {}, events: [
  { kind: "turn_ended", outcome: { kind: "aborted" } }] }, at);

const view = viewOf(k.records());
console.log(view.status.kind, view.messages.at(-1)?.outcome);
console.log(view.pendingInputs.map((input) => [input.input, input.state]));
idle { kind: 'aborted' }
[ [ 'also check the tests', 'accepted' ] ]

To see it live: prompt codex with something that runs one long command (sleep 60), steer() while the command runs, then abort(). The turn/completed arrives with no userMessage item for the steer's clientUserMessageId.

Expected

The adapter records what codex did, the same inference codex's own client makes: on a root turn/completed with status interrupted, every steer accepted for that turn (its expectedTurnId) that hasn't been echoed was dropped. One possible shape (yours to choose):

  • an event on that frame, e.g. input_dropped { inputId, reason: "turn_interrupted" }, which the conversation reducer folds as ConversationInput.state: "dropped";
  • in the view, a dropped input leaves pendingInputs and enters messages where it was dropped (the end of that turn), the way a refused input enters where it was refused.

A host can then show it as "not read" and offer to send it again, which is what codex's TUI does. Ferry will show it in the transcript with Resend, as it already does for an input the runtime refused. Ferry won't send it again by itself: a person's stop pauses Ferry's queue.

Worth checking in the same pass:

  • claude: the interrupt's control_response carries still_queued (docs/runtimes/claude.md). We haven't verified whether a steer written to stdin survives an interrupt (and runs as a spontaneous turn) or is cancelled (interrupt_cancel_queued_v1). If it is cancelled, claude has the same gap.
  • exit: an input still pending when the process exits is gone too. Ferry already shows an ended run's pendingInputs as "Not read by the agent". A view-level rule ("an exit drops what's pending") would give every host the same.

Ferry side

Ferry's mock runtime now drops an unread steer on abort, as codex does. Its integration test "doesn't keep a steer waiting for an agent that stopped its turn without reading it" is it.fails until this ships. Ferry will adopt the new state then (decision D088).

Activity

  1. xxchan commented on Oct 8, 2026

    @xxchan
    MemberAuthor

    Decided by @cindy: yes. The drop is recorded as a runtime fact by the adapter. The view never infers it from a turn end.

    The current rule ("an input never echoed stays pending, even after its turn ends") stays as written for runtimes that keep the input. What changes is that an adapter which knows its runtime discarded an input now says so on the frame that proves it. This is the same inference codex's own client makes (input_restore.rs), and it rests on the same source.

    Contract

    • New event: input_dropped { inputId, reason: "turn_interrupted" }, added to RuntimeEventBody. An adapter emits it only where the runtime's own behavior (source or a recorded probe) shows the input was discarded. The runtime page cites that evidence.
    • codex: on a root turn/completed with status interrupted, emit one input_dropped for every steer accepted for that turn (its expectedTurnId) that has no userMessage echo. Emit it on that frame, ahead of turn_ended.
    • Conversation and view:
      • ConversationInput.state gains "dropped", carrying its reason.
      • A dropped input leaves pendingInputs and enters messages where it was dropped, the same way a rejected input enters where it was refused.
      • The caller owns the input again: nothing read it, so sending it again does not duplicate it.
    • Process exit, a fold rule from the exited record. It falls under liveness.md's "death settles what was waiting":
      • Inputs still pending at exit become dropped with reason: "runtime_exited". This covers inputs the adapter still held and accepted inputs never echoed.
      • The docs must be honest about it: runtime_exited means "not seen read before the process ended". A runtime that took the input just before dying, without its echo reaching stdout, could still have it in a resumed transcript.
      • Streams that place inputs at their request (ACP, pi, cursor) have no pending inputs, so nothing changes there.

    Same pass, audit each runtime with steer. For each, check what happens to an accepted, unread steer on abort, using real CLIs and SDKs against the scripted provider. No real accounts.

    • claude: what the interrupt's control_response still_queued and claude's cancel_queued markers (unmapped today) say. If claude cancels the input, map that marker to input_dropped. If it keeps the input and runs it as a spontaneous turn, nothing changes.
    • pi: what abort() does to its steering queue.
    • ACP runtimes with steer, and cursor: the same question.
    • Any runtime where the answer is "discarded, with no native word": the page says so, and the event comes only from the source-backed rule, as for codex.

    Tests:

    • the issue's repro as a fold test (steer ends dropped, the view's pendingInputs is empty, the message sits at the turn end);
    • an exit test;
    • a codex projection test: an interrupted turn/completed with one echoed and one unechoed steer drops only the unechoed one;
    • a vendor test on real codex with a scripted provider.
  2. added 2 commits that reference this issue on Oct 8, 2026
    d2af92b
    627b22a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions