Skip to content

fix(tui): consumed steering message is never projected into the transcript #3304

Closed

Description

@me2seeks

Summary

When a steering message is sent while the TUI is mid-turn (Enter during "Working…"), the model receives it (visible in thinking), but the message is never projected into the TUI transcript — the pending Steering: … bar clears and no user message is rendered in its place.

Expected

A consumed steering message is rendered in place as a user turn in the transcript (this is what pi-transcript.ts does for steering_message events: packages/cli/src/pi-transcript.ts → applyMakaSessionEventToTranscript → appendUserPrompt).

Actual

Nothing is rendered. After the run consumes the steering, the transcript shows no trace of the user's interjection (until a full session reload).

Root cause

The host-backed TUI has exactly one live render path for steering, and it is racy by construction:

  1. The kernel echoes a durable steering_message session event when the run drains steering at a step boundary (packages/runtime/src/ai-sdk-backend.ts → drainSteeringInto, ~4755). This is what makes the ledger/transcript correct.

  2. But the Runtime Host event pump drops that event for subscribers: root-turn-coordinator.ts (~2099) only forwards isRuntimeSessionTransientEvent types (text/thinking/tool/provider_retry) to acceptRuntimeEvent, and RuntimeSessionTransientEvent (session-continuity-coordinator.ts:63) does not include steering_message. It doesn't even trigger enqueueCanonicalRefresh.

  3. So the client's only live source is the projector synthesizing steering_message from queue entries observed in the transient in_flight state (packages/runtime-host/src/adapter/session-projector.ts → accept() → newlyInFlight, ~344).

  4. That in_flight window (message-coordinator #pull → #ack, ~1116–1150) is milliseconds, and the projection reaches subscribers only through an async, coalesced canonical refresh (#mutated → onProjectionChanged → enqueueCanonicalRefresh → session lane → #readCanonicalProjection). If no refresh observes the intermediate state — easily the common case under load — the subscriber sees the queue jump queued → [] and the projector emits only queue_update (empty): no steering_message is ever emitted.

Reproduction (projector level)

Feeding RuntimeHostSessionProjector the two snapshots a subscriber actually receives in the racy case:

  • prev: queue.steering = [{ state: 'queued', … }], queueRevision: 2
  • next: queue.steering = [], queueRevision: 4 (in_flight state never observed)

produces only:

[{ "type": "queue_update", "steering": [], "followup": [] }]

— no steering_message. Feeding the intermediate { state: 'in_flight' } snapshot does produce steering_message, confirming the render depends entirely on observing a transient queue state.

Fix direction

Make the authoritative, durable steering_message a first-class event for session subscribers instead of relying on observing the transient in_flight queue state — e.g. extend the host event pump / RuntimeSessionTransientEvent to forward steering_message (it has no toolUseId, so the session-event frame shape needs a small generalization), and keep the queue projection responsible only for the pending Steering:/Queued: bar. The client reducer (pi-transcript.ts:752) already renders it; the desktop projector (packages/ui/src/live-turn-projection.ts:169) would benefit from the same fix.

Environment

  • maka TUI against Runtime Host, observed on main (6095203)

Activity

  1. me2seeks commented on Aug 20, 2026

    @me2seeks
    ContributorAuthor

    I'm working on this.

  2. added a commit that references this issue on Aug 20, 2026
    5d8605a
  3. added
    bug
    help wanted
    on Aug 20, 2026
  4. added 3 commits that reference this issue on Aug 22, 2026
    8e2be84
    7f07c93
    601d238
  5. added 2 commits that reference this issue on Aug 23, 2026
    63e9340
    e0e5abc
  6. added a commit that references this issue on Aug 26, 2026
    a6866d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions