docs: state current behaviour (wake path, subagent todo)
This commit is contained in:
parent
7d352486cd
commit
79ada8aace
2 changed files with 13 additions and 10 deletions
|
|
@ -132,16 +132,19 @@ Silently exits when the primary account has no token yet; the
|
||||||
appears, and, on an agent with a store, a timer restarts it while it's
|
appears, and, on an agent with a store, a timer restarts it while it's
|
||||||
down so it re-reads a token the swarm minted into the store.
|
down so it re-reads a token the swarm minted into the store.
|
||||||
|
|
||||||
Incoming room events wake the agent via `AgentRequest::Wake` with
|
**Wake path**: after every sync the daemon upserts a harness-local todo
|
||||||
`from: "matrix"`. The wake body format depends on the unread state:
|
on the in-agent socket for each unread room (keyed by its room id) and
|
||||||
|
each pending invite (below). A new or changed todo wakes the agent with
|
||||||
|
the generic prompt `you have todos — call get_loose_ends to see them`
|
||||||
|
(from `todo`). The `[matrix]` lines reach the agent through
|
||||||
|
`get_loose_ends`, one per room, as
|
||||||
|
`- todo #<id> [matrix <room_id>, <age>s old]: <summary> (cancel_loose_end …)`.
|
||||||
|
The summary depends on the room's unread state:
|
||||||
|
|
||||||
- **Single room, one message**: `[matrix] <sender> in <room>: <body> —
|
- **One unread message**: `[matrix] <sender> in <room>: <body> —
|
||||||
use read_room to view, mark_read to clear`
|
use read_room to view, mark_read to clear`
|
||||||
- **Single room, multiple messages**: `[matrix] N unread in <room> —
|
- **Several unread messages**: `[matrix] N unread in <room> —
|
||||||
use read_room to view, mark_read to clear`
|
use read_room to view, mark_read to clear`
|
||||||
- **Multiple rooms**: `[matrix] unread messages:` followed by a
|
|
||||||
bulleted list (`- <room>: <sender>: <body>` or `- <room>: N unread`
|
|
||||||
per room)
|
|
||||||
|
|
||||||
**Multi-account prefix**: when the daemon serves more than one account
|
**Multi-account prefix**: when the daemon serves more than one account
|
||||||
(`services.hyperhive.agent.matrixAccounts`), it prefixes every wake body and every invite todo
|
(`services.hyperhive.agent.matrixAccounts`), it prefixes every wake body and every invite todo
|
||||||
|
|
|
||||||
|
|
@ -234,8 +234,8 @@ early exit — and on this box both land inside a second, so a `continue`
|
||||||
that works answers about as fast as it did before. A five-second cap
|
that works answers about as fast as it did before. A five-second cap
|
||||||
bounds the one case neither covers: a child that neither speaks nor
|
bounds the one case neither covers: a child that neither speaks nor
|
||||||
exits, reported as started, with the end-of-turn todo left to say how it
|
exits, reported as started, with the end-of-turn todo left to say how it
|
||||||
goes. That todo carries every failure that happens later in the turn,
|
goes. That todo carries every failure that happens after the one
|
||||||
starting after the miss `continue` already handed the caller directly.
|
`continue` already returned to the caller.
|
||||||
|
|
||||||
## A killed turn
|
## A killed turn
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue