steering demoable: the Enter branch keys on BUSY (own-stream clears turnInFlight — Enter was swallowed during our own turn), and the button follows the text (owner live report 2026-10-03)
Root cause: doSteerOrSend branched on turnInFlight, but the local dedup (chat.tsx ~370) clears that flag the moment the own stream takes over — during our own turn busy was true and turnInFlight false, so Enter fell to the plain-send path whose busy guard returned silently. Branch on busy: own stream AND foreign/wake turns both have a live agent registered by the time the send's POST resolved, so the steer lands (a raced settle 409s and falls back to the plain send). The button now follows the text: busy + typed text = Send (click steers — steering must be clickable, not Enter-only); busy + empty = Stop. ESC keeps its confirm-popup abort in every state, so stop is never unreachable.
This commit is contained in:
+9
-6
@@ -920,17 +920,20 @@ export function Chat({
|
||||
void send({ type: "text", text: t });
|
||||
};
|
||||
|
||||
/* STEER VS SEND (owner arc 2026-10-03): Enter while a turn runs steers
|
||||
/* STEER VS SEND (owner arc 2026-10-03): a send while a turn runs steers
|
||||
* it — the quiet queue + the live agent's steering rail; the turn's own
|
||||
* stream lands the card when pi drains it. Any other state (idle,
|
||||
* submitted microtask window, a wake turn between our renders) takes the
|
||||
* plain send — a steer POST with no live turn would 409 and fall back
|
||||
* to exactly that anyway, so we only branch on the state we trust. */
|
||||
* stream lands the card when pi drains it. The branch is BUSY, not
|
||||
* turnInFlight: the own-stream case CLEARS turnInFlight (the local
|
||||
* dedup, chat.tsx ~370), so branching there swallowed Enter entirely
|
||||
* during our own turn (owner live report, fixed same day). busy covers
|
||||
* own stream AND foreign/wake turns — both have a live agent by the
|
||||
* time the send's POST resolved, so the steer lands. Idle takes the
|
||||
* plain send; a raced settle 409s and falls back to exactly that. */
|
||||
const doSteerOrSend = () => {
|
||||
if (pending) return;
|
||||
const t = textRef.current.trim();
|
||||
if (!t) return;
|
||||
if (turnInFlight) {
|
||||
if (busy) {
|
||||
applyText("");
|
||||
void steer(t);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user