Repository navigation
Description
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:
-
The kernel echoes a durable
steering_messagesession 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. -
But the Runtime Host event pump drops that event for subscribers:
root-turn-coordinator.ts(~2099) only forwardsisRuntimeSessionTransientEventtypes (text/thinking/tool/provider_retry) toacceptRuntimeEvent, andRuntimeSessionTransientEvent(session-continuity-coordinator.ts:63) does not includesteering_message. It doesn't even triggerenqueueCanonicalRefresh. -
So the client's only live source is the projector synthesizing
steering_messagefrom queue entries observed in the transientin_flightstate (packages/runtime-host/src/adapter/session-projector.ts→accept()→newlyInFlight, ~344). -
That
in_flightwindow (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 jumpqueued → []and the projector emits onlyqueue_update(empty): nosteering_messageis 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
me2seeks commentedon Aug 20, 2026
I'm working on this.
fix(runtime-host): forward the durable steering echo to session subsc…
fix(runtime-host): forward the durable steering echo to session subsc…
fix(runtime-host): forward the durable steering echo to session subsc…
fix(runtime-host): forward the durable steering echo to session subsc…
fix(runtime-host): forward the durable steering echo to session subsc…
fix(runtime-host): forward the durable steering echo to session subsc…
fix(runtime-host): forward the durable steering echo to session subsc…