fetch the agent's backend env file from the store, seeded from the existing file
the agent's own root unit reads swarm/agents/<agent>/backend-env into /run and creates it from backendEnvironmentFile with -cas=0 when the store holds nothing. the shared agent policy gains create (not update) on that one leaf. the harness and the subagent daemon load the old file first and the fetched one after it.
This commit is contained in:
parent
5486fc0333
commit
75e9e205e3
1 changed files with 933 additions and 31 deletions
|
|
@ -277,6 +277,18 @@ is a no-op without the other:
|
|||
(`hive-subagent-daemon`) loads the same file, so the agent's claude
|
||||
subagents run on the same key.
|
||||
|
||||
On an agent with a secret store (`services.hyperhive.agent.bao.addr`) that uses
|
||||
`useApiKey` or the `acp` runtime, `hive-agent-backend-env.service` also keeps the
|
||||
file's text in the store at `swarm/agents/<agent>/backend-env`, field `env`, and
|
||||
writes it to `/run/hive-agent-backend-env/env` every 2 minutes. When the store
|
||||
holds nothing there, the unit creates the leaf from `backendEnvironmentFile`,
|
||||
byte for byte and once; it never rotates a value and never rewrites or deletes
|
||||
the file. The harness and the subagent daemon load `backendEnvironmentFile`
|
||||
first and the `/run` file after it, so a variable the store holds wins, and with
|
||||
the store down at a start the file alone carries the agent. Both read it at
|
||||
their own start, so a changed value reaches a running agent at its next
|
||||
restart.
|
||||
|
||||
Provision the file once, out of band (never through nix — an API key in
|
||||
the store is world-readable and travels with the flake closure):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue