the agent state stream sends a new client the latest header first
The stream was a live tail with no replay, and the agent re-sends its header once a minute, so a card opened mid-idle read "no report yet" for up to a minute. The controller already follows every agent's header for the inference route; it now keeps the newest one as published, and the stream sends it first when it is under 150 seconds old. An agent that stopped keeps no state older than that.
This commit is contained in:
parent
cfd2f340fb
commit
ff3d119c63
2 changed files with 84 additions and 8 deletions
|
|
@ -274,7 +274,8 @@ That's the whole point of the subject — the `agent-status` bucket already
|
|||
republishes once a minute, which is far too slow for "is this agent thinking
|
||||
right now." A core subject keeps nothing for a late subscriber, so the harness
|
||||
also re-sends the current header once a minute: a subscriber attaching
|
||||
mid-idle sees it within that minute. A renderer opens with the bucket's
|
||||
mid-idle sees it within that minute. The swarm's stream sends a new client the
|
||||
latest header it holds first, when that's under 150 seconds old. A renderer opens with the bucket's
|
||||
snapshot and lets this stream refine it.
|
||||
|
||||
Swarm-side, `GET /api/agents/<name>/state/stream` relays that subject as SSE,
|
||||
|
|
|
|||
|
|
@ -93,8 +93,10 @@ The preview carries only the connection badge and **expand**, so it stays clear
|
|||
of the text. What the agent is doing shows in the details table above it, in
|
||||
the **state** row: the turn state (idle, thinking or compacting), a **paused**
|
||||
badge for a paused agent, and the tokens in its context and billed. The row
|
||||
reads "no report yet" until the first report arrives, and for an agent that's
|
||||
offline. The agent sends a report when its state changes and once a minute. If
|
||||
shows the latest report the controller holds, if it's under 150 seconds old, as
|
||||
soon as you look. It reads "no report yet" when there is none: for an agent
|
||||
that's offline, and until the first report after the controller restarts. The
|
||||
agent sends a report when its state changes and once a minute. If
|
||||
the browser gives up on the stream, a **reconnect** badge opens it again. The
|
||||
terminal's own tab keeps these badges, with the model and the effort, beside the
|
||||
connection badge; the turn-state badge says how long the agent has been in that
|
||||
|
|
|
|||
Loading…
Reference in a new issue