Skip to content

v0.9.14: runtime API steer receipts claim delivery the engine never made — item.completed emitted unconditionally, dropped steers reported as sent #6276

Description

@Hmbown

Why this matters

Steering is the user's only way to redirect a running turn. Today the runtime API reports a steer as delivered before the engine decides, and the engine can silently drop it — so a client tells the user "Guidance sent", clears their composer, and their words never reach the model. Input silently lost.

Current behavior

  • crates/tui/src/runtime_threads.rs:9575 steer_turn: reserves channel capacity, persists the steer item as already Completed, then spawn_steer_receipts (runtime_threads.rs:8890) emits turn.steered + item.completed unconditionally — the code comment says "after engine acceptance" but no acceptance check exists.
  • Engine side: crates/tui/src/core/engine.rs:1285 next_turn_steer drains the channel and discards any steer whose turn has moved on; turn-loop interrupt/failure paths drop pending_steers (turn_loop.rs:48, :809, :2074).
  • The Ratatui TUI presentation path was made honest in 9efb4ba (Steered input is not inserted as the newest history entry: it lands above in-flight work and reads as out of order #6190); the runtime API layer serving GPUI/ACP/SDK clients never got the equivalent.

Repro (live)

GPUI client steering a running turn (Enter while active turn): the app showed its sent-confirmation and cleared the composer; the model never received the text mid-turn, and the durable record still shows the steer item completed. Session: 6453856f-10b5-4a9b-947c-dcac902071d3.

Desired behavior

  1. The engine reports each steer's real outcome (committed into the turn's record vs dropped).
  2. steer_turn settles the item truthfully: Completed only on commit; dropped steers settle as canceled/not-delivered with an event, and the API returns a typed error (e.g. 409 turn-moved-on) so clients can requeue instead of trusting a lie.
  3. Invariant (grokbuild's interjection tests in refs/grokbuild PTY suites): user guidance either reaches the model or is visibly returned — never silently dropped.

Acceptance criteria

  • Regression test: steer accepted into the channel, turn ends before the engine commits it → API returns the typed drop error (or truthful not-delivered receipt); no turn.steered/item.completed success events for it
  • Steer committed at a step boundary still produces item.completed (existing happy path preserved, test green)
  • Focused cargo test -p codewhale-tui --lib --locked green for runtime_threads steer tests

Related

Activity

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

    bugSomething isn't workingreliabilityReliability, flaky behavior, retries, fallbacks, and robustness

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions