feat(claw): a message into a live turn steers it

The resident dispatch's turn now runs under a steer select: the
messages route, after its ingest, signals a per-key interrupt registry,
the drop lands at the turn's current await (an in-flight shell command
dies with it), the dangling calls close, and the dispatch loops on the
same lease — the steered message runs as the next round, same session,
same stream. The interrupted turn closes on the stream with turn_done
carrying outcome "steered", and the shim's whole and streamed
answers both wait through steered end markers for the round that
actually replies.

The messages route answers 202 the moment the message is accepted; the
drain pass runs detached, so a turn's minutes never hold the request
open. The web composer leans on that: it never closes for a running
turn, the placeholder and the send button say that sending steers, a
steered outcome gets its own tone, and the sent-row echo dedup pops a
pending list instead of comparing the last item — a steered chain's
extra end marker can no longer double the row.
This commit is contained in:
vhaudiquet committed 2026-11-08 18:00:39 +01:00
1 parent 853c5a547c
commit 041240f706
11 files changed
+857 -40

No files matched your search

+9
View File
@@ -178,6 +178,15 @@ client mirrors the stream rather than managing history. The OpenAI shim
and the message POST read the live feed only — replay never reaches a
turn that is starting.
A message into a session whose turn is running **steers** it, the same
interrupt rhema-code's UI owns: the running turn is cut at its current
await (an in-flight shell command dies with it), closes on the stream
with `turn_done` carrying `outcome: "steered"`, and the message runs as
the next turn of the same conversation. The messages route answers 202
the moment the message is accepted — the turn runs off the request, and
its reply arrives on the event stream — so a composer never locks for
the length of a turn and a follow-up is always typeable.
Every provider whose credentials resolve (env, the claw's own stored
logins, or the stored rhema config) is constructed at boot as a backend
*instance* named by an id, the kind unless a login named it, so two