Watch
0
0
Fork
You've already forked hyperhive
0

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:
iris 2026-11-15 16:06:17 +01:00 • committed by mara
commit 91cf4d2ae1
2 changed files with 389 additions and 8 deletions

View file

@ -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

View file

@ -178,7 +178,7 @@ you flip it follow it.
A terminal's own tab takes the agent's icon as its browser-tab icon, so tabs of
different agents tell apart. A subagent's tab shows its agent's icon. An agent
with no icon keeps the hyperhive mark.
with no icon keeps the default agent icon.
The tab also has an agent badge, with the agent's icon and name, ahead of the
connection badge. It opens the agent's details in a popover under the badge: