Skip to content

feat: surface discarded steering inputs - #241

Merged
xxchan merged 1 commit into
mainfrom
fix/dropped-inputs
Oct 8, 2026
Merged

xxchan merged 1 commit into
mainfrom
fix/dropped-inputs

Conversation

@xxchan

@xxchan xxchan commented Oct 8, 2026

Copy link
Copy Markdown
Member

An accepted Codex steer can be discarded when its turn is interrupted without ever producing a user-message echo. The conversation view currently leaves that input in pendingInputs, so hosts cannot tell that they own it again.

This adds the runtime event input_dropped { inputId, reason: "turn_interrupted" }. Codex emits it for accepted, un-echoed steers belonging to the interrupted root turn, on the same frame immediately before turn_ended. Echoed inputs, other turns, child completions and the durable queue are excluded. Conversation inputs gain state: "dropped" and a reason, leave the pending tray, and enter the transcript at the discard. Retrying the same input ID starts a new delivery attempt without inheriting an earlier acceptance.

An exited record separately settles inputs still awaiting echoes as dropped with reason: "runtime_exited". This is an observation gap, not proof the runtime never read or persisted the input. A later correlated echo can replace that exit-only inference if no new attempt intervened. Original controls and native records remain unchanged.

The native audit and rerunnable probe are in experiments/input-interruption-2026-10-08.md. Claude, Pi and OpenCode retained the tested interrupted input. Cursor's SDK returns undelivered steering for refusal; verification is limited to source and adapter tests. Grok can lose a replacement prompt, but the same cancellation category also occurs after input was read, so no speculative discard mapping is added.

Validation: full CI=1 pnpm run check (1177 tests and mock behavior), scripted/Claude/Codex/Pi behavior backends run serially, the Codex native vendor suite, and package builds. All native conversations used local scripted model providers and temporary homes, without real accounts or model quota. Regression coverage includes the original fold reproduction, process exit and resumed echo, retry boundaries, Codex projection ordering and a native Codex discard test.

Closes #236.

@xxchan
xxchan merged commit d2af92b into main Oct 8, 2026
13 checks passed
@xxchan
xxchan deleted the fix/dropped-inputs branch October 8, 2026 10:21
@xxchan xxchan mentioned this pull request Oct 8, 2026
xxchan added a commit that referenced this pull request Oct 8, 2026
Release OAR and CLI 0.43.0. This PR changes only the two package version
fields.

**New** (#241, closes #236)
- `RuntimeEventBody` gains `input_dropped { inputId, reason:
"turn_interrupted" }`: the runtime discarded an input, established by
its native marker or documented behavior, never inferred by a view. Code
with an exhaustive `switch` over event kinds needs the new case.
- codex: on a root `turn/completed` with status `interrupted`, every
steer accepted for that turn and never echoed is dropped (codex clears
pending steering on interrupt; its own TUI restores exactly those).
- claude, pi and opencode keep an unread steer and deliver it later, so
they emit nothing. cursor answers an undeliverable steer
`revert_to_followup`, already recorded as a rejection. grok answers a
steer that was cancelled before or after the model read it the same way
(`cancelled`, `MidTurnAbort`), so it emits nothing; the gap is on its
page.
- `ConversationInput.state` gains `"dropped"` with `reason:
"turn_interrupted" | "runtime_exited"`. A dropped input leaves
`pendingInputs` and enters `messages` where it was dropped, as a
rejected input does. The caller owns it again.
- Process exit: inputs still waiting for an echo when the runtime exits
become `dropped` with `reason: "runtime_exited"`. This means no read was
observed before the exit, not proof the runtime never read it (codex's
durable queue can survive in its session). A later echo, on resume,
undoes an exit-only drop if no new attempt came in between.
- A resend with the same `inputId` starts a fresh delivery history.
- `ConversationState` gains a `drops` map, so incremental and replayed
folds agree.

Known gap, tracked in #242: on streams that place inputs at their
request (ACP runtimes, pi, cursor), a queue input the adapter still
holds when the process exits still looks delivered.

Validation: all 13 checks passed on #241's final head (`d61de8c`), and
the merged tree equals its CI tree. After this PR passes CI and merges,
tag its exact squash commit as `v0.43.0` to trigger npm trusted
publishing.

🤖 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]>
xxchan added a commit that referenced this pull request Oct 8, 2026
The `accepted` response for prompt, steer and queue said "do not
resubmit" with no exception, and conversation.md repeated it. Since
0.43.0 (#241), a later `input_dropped` or the `dropped` state at exit
hands the input back to the caller. This states the exception where the
rule is written. Raft's OarHost acks on `steered` and asked how a later
drop fits.

🤖 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants