hive-bash-mcp: publish each task's status and output to the swarm queue
This commit is contained in:
parent
faadc5abe2
commit
c0b9c1778c
1 changed files with 841 additions and 211 deletions
|
|
@ -78,6 +78,29 @@ unread rooms. An inline `wait_seconds` / `status` observation that already
|
|||
delivered the result instead clears the keyed todo, so no redundant
|
||||
loose-end follows.
|
||||
|
||||
### Status and output the swarm sees
|
||||
|
||||
The daemon also tells the swarm about each task, so the swarm UI can list the
|
||||
running ones and read their output without calling the agent
|
||||
(`swarm_wire::bash_task`; the bucket, the stream and the grants are in
|
||||
[`controller.md`](../swarm/controller.md)). It publishes as the agent, over the
|
||||
connection `swarm_queue_client::agent_publisher` makes with the agent's own
|
||||
queue credential, and publishes nothing in a container without a queue address
|
||||
or a secret store. Everything is best-effort: a failed connect or publish is a
|
||||
log line, and a task never waits on the queue.
|
||||
|
||||
- **Status.** The runner writes a task file at every state change, and each
|
||||
write also publishes the task's state to `$KV.bash-task-status.<agent>.<task>`.
|
||||
While a task is `pending` or `running`, the publish task repeats it every 60
|
||||
seconds, so a daemon that died reads as stale. A finished task leaves that
|
||||
repeat.
|
||||
- **Output.** A task's output goes to files, so while it runs the daemon reads
|
||||
what the files gain twice a second and publishes it as rows on
|
||||
`$SWARM.term.<agent>.bash.<task>`, each with the `Swarm-Stream` header
|
||||
(`stdout` or `stderr`). A chunk never splits a character, and one larger than
|
||||
the queue's payload limit goes out in pieces. When the process exits, the daemon
|
||||
publishes what the files still hold before it writes the final status.
|
||||
|
||||
## Relationship to the `execution` permission
|
||||
|
||||
`Permission::Execution` (in `Permission::DEFAULT`) is the real gate on bash:
|
||||
|
|
|
|||
Loading…
Reference in a new issue