swarm-controller: cap a subagent terminal stream's disk use
The controller-created term-sub-<agent> stream had max_age only, so a publishing agent could grow it without bound for 24h. Add a 64 MiB max_bytes cap with discard: Old (oldest rows drop first, publish never fails on the cap), and size max_message_size off the queue's live max_payload rather than a hardcoded guess.
This commit is contained in:
parent
f9feb93ced
commit
e21546d08d
2 changed files with 56 additions and 16 deletions
|
|
@ -174,10 +174,12 @@ subagent daemon: each subagent's rows go to `$SWARM.term.<agent>.sub.<subagent>`
|
|||
classified the same way. The queue grants that family to the agent's own queue
|
||||
credential alone, so the daemon reads it from the store under the agent's store
|
||||
identity, exactly as the harness does, and publishes nothing without it. The
|
||||
queue keeps these rows in the stream `term-sub-<agent>` for 24 hours, and the
|
||||
swarm lists an agent's subagents from that stream's subjects. The swarm
|
||||
controller creates that stream for every agent a hive's wanted state names,
|
||||
within a minute of the agent appearing there. The agent's grant is publish on its own
|
||||
queue keeps these rows in the stream `term-sub-<agent>` for 24 hours or 64 MiB,
|
||||
whichever comes first, dropping the oldest rows once either limit kicks in so
|
||||
a publish never fails because of it, and the swarm lists an agent's subagents
|
||||
from that stream's subjects. The swarm controller creates that stream for
|
||||
every agent a hive's wanted state names, within a minute of the agent
|
||||
appearing there. The agent's grant is publish on its own
|
||||
`$SWARM.term.<agent>.sub.>` and no `JetStream` subject, so the stream's
|
||||
subjects and limits are the controller's and never the agent's. Subagents
|
||||
publish output only and read nothing.
|
||||
|
|
|
|||
Loading…
Reference in a new issue