icons for the swarm's own forge accounts, and a default agent icon
The builder, ci-metrics and review-classifier forge accounts get an avatar: an icon each in a hexagonal frame, the hyperhive logo when one is missing. The controller sets them with a short-lived write:user token it mints for the account, since only an account can set its own avatar. An agent with no icon of its own shows a default agent icon in the swarm UI, a robot head in a round frame, instead of the dimmed hyperhive mark.
This commit is contained in:
parent
51479d9fe8
commit
91cf4d2ae1
1 changed files with 389 additions and 8 deletions
|
|
@ -258,8 +258,8 @@ once per start, because a config change reaches an agent by restarting its
|
|||
container. An agent with no icon deletes its key. Swarm-side,
|
||||
`GET /api/agents/<name>/icon` serves
|
||||
the stored bytes, and 404 means the agent has no icon. swarm-ui's agent cards
|
||||
load it as an `<img>` and show the dimmed hyperhive mark for an agent without
|
||||
one, as the hive dashboard does.
|
||||
load it as an `<img>` and show the dimmed default agent icon (a robot head in a
|
||||
round frame, `branding/agent-default.svg`) for an agent without one.
|
||||
|
||||
The fourth is its **`AGENTS.md`**, which goes into the `agents-md` bucket under
|
||||
the key `<agent>`, writable by the agent's own credential alone
|
||||
|
|
@ -363,6 +363,17 @@ one per hive. It ensures them at start and every five minutes after
|
|||
- the `agent-configs` org avatar
|
||||
(`deploy.swarm-controller.configOrgAvatarPng`).
|
||||
|
||||
The swarm's own forge accounts (`builder`, `ci-metrics` and `review-classifier`)
|
||||
get an avatar too, from a separate pass in the controller (`forge/service_avatars.rs`).
|
||||
Each has an icon in a hexagonal frame (`branding/service-<login>.svg`, rendered to a PNG
|
||||
in the assets package) and falls back to the hyperhive logo. Only an account can set its own
|
||||
avatar, so the pass mints a short-lived `write:user` token for it with the admin API, uploads
|
||||
the image, and deletes the token. A marker per account in the state directory
|
||||
(`forge-service-avatar-<login>`) holds the image's SHA-256, so a changed icon uploads again
|
||||
and an unchanged one doesn't. The directory with the icons is
|
||||
`SWARM_CONTROLLER_SERVICE_ICON_DIR`, set by the nix module. An account that doesn't exist yet
|
||||
gets passed over and shows up on the next pass, every five minutes.
|
||||
|
||||
A pass that can't finish logs a
|
||||
`warn` line per object plus `swarm forge objects: pass incomplete` in
|
||||
`journalctl -u swarm-controller`, and retries on the next tick. While the
|
||||
|
|
|
|||
Loading…
Reference in a new issue