OpenProgram Docs

Agent avatars

Every Agent has a picture beside its name. One never given one shows a character derived from its id, so no surface falls back to a generic icon and no stored Agent needs a migration. Agents use the profile picture's Avatar and AvatarConfig (apps/web/components/avatar/); the character is one more kind beside dicebear, upload and letter.

The character

PartValues
Shape22: chat, controller, mug, lightbulb, sprout, watering-can, barbell, book, brain, bull, bunny, camera, cat, cloud, ghost, magnifier, paint-brush, palette, rocket, shield, star, witch-hat
Colour8 named colours: blue, orange, green, violet, pink, teal, yellow, red
Eyeswhite
Moodidle, thinking, happy

Catalogue: components/avatar/bot/catalog.ts. A colour is stored by name and drawn in one fixed hex; character art is the one place outside the theme. Tiles, rings and labels use theme tokens.

The character an id gets

FunctionRule
botLookFor(id), bot/identity.ts32-bit FNV-1a: shape from the hash, colour from its high 16 bits, so they do not move together. Built-in Agents use a table (PR Verifier shield, Research Desk brain, Knowledge Keeper sprout); no two share a shape.
agentAvatarConfig(agent), lib/agents/agent-avatar.tsThe saved avatar, or the id's character when there is none or an upload's picture is missing

Storage

AgentSpec.avatar in <state>/agents/<id>/agent.json, in every Agent listing.

FieldUsed byRule
kindallbot, dicebear, upload or letter; required when the avatar is not empty
shape, colorbota short slug; the web catalogue decides which exist, and an unknown one draws the id's character
style, seeddicebeara slug; up to 120 characters
fileuploada data:image/ URL of at most 350,000 characters
letter, bgletterup to 2 and 40 characters
  • {} means no avatar of its own, the default. A patch replaces the avatar whole.
  • The API validates strictly and refuses with 400 (validate_avatar in openprogram/runtime/agent_registry/manager.py). Loading is tolerant: a stored avatar that no longer validates reads as {}.
  • The Agent picker caps uploads at 256 KB, since every listing carries the picture.
  • A trial conversation's configuration snapshot leaves the avatar out.

Rendering

ModeWhat is drawnWhen
Stillone static SVGAvatar's default
Livea canvas that blinks, sways and looks aroundlive; AgentAvatar's default

Renderer: open-bot-avatar, loaded on first use by bot/runtime.ts. BotAvatar mounts into a host element of the asked size. Live characters share one animation loop, pause off screen and when the page is hidden, and are the still picture under reduced motion.

The silhouette is the picture: no circle clip, no tile. Uploaded and generated Agent pictures keep a rounded-square frame. app/styles/design/icons.css keeps a character's drawing at its body box's size inside controls that size svgs as icons.

Warm-up: no frame spent preparing shapes

The renderer infers a shape's volume from its outline on first draw, 25 to 90 ms a shape, kept for the page's life. Seventeen Agents at once cost over half a second in one frame, and a still picture needs the same work.

bot/warm.ts prepares one shape per task: a waiting one in the next task, the rest in idle time after the renderer loads. Until ready, and in server markup, a character is its flat glyph in the box the renderer will use; the renderer replaces it in the same commit.

Looking around

The built-in idle wander moves the eyes about a pixel at icon size, in step across a shape. bot/wander.ts gives each character its own lookAt targets instead:

AspectValue
Hold0.9 to 2.6 s
Reachx up to 0.95, y up to 0.6 of the range; at least about a third to one side
Straight aheadOne glance in four
CostOne timer per character, one firing per glance; random start and pauses
MoodThinking or happy keeps its pose

followPointer stays off: tracking the cursor reads as watching the user, and it would call getBoundingClientRect every frame.

Optical size

The drawings leave different margins in their 100-unit box: cloud 82 x 52, ghost 54 x 76. BotAvatar has a slot at the asked size and a body box inside, which the renderer draws into at the size that shows.

FitUsed inRule16px cloud
botFitEverywhere elseGeometric mean side 0.8 of the slot, no side over 0.94, centred (from BOT_EXTENTS, checked by a test)About 15 x 9.5px
botMarkFit, fit="mark"Composer Agent chip, Agent menu rows (fill rule)Longer side equals the 16 x 16px slot, centred16 x 10.1px

Uploaded, letter and DiceBear avatars already fill the slot, so fit="mark" only gives them the 18px hover.

Hover

The slot pops with its control exactly as an icon does: components/ui/hover-pop.ts holds the clickable-host selector, 1.12 scale and spring, shared by SolarIcon and BotAvatar. Outside a control it follows its own hover. In the composer's Agent chip and Agent menu rows it grows to exactly 18 x 18px (HOVER_POP_FILL). Reduced motion turns it off.

Where it shows

SurfaceSizeMode
Agents page: card, quick settings head32live
Agents page: editor header40live
Agents page: list rail16live
Avatar picker shape tiles34still
Composer Agent chip16live
Agent menu rows16live
Name above a reply from an Agent other than the default18live
Activity panel: Always-on row22live, thinking while the Agent works
Activity panel: Always-on detail head16live
Settings: channel bindings16live
Graph: agent reply and sub-agent start nodes, legend16flat glyph in the branch colour
Activity panel: agent and sub-agent rows22 (16 in a detail head)flat glyph in the branch colour

AgentAvatar is live unless a caller turns it off; picker tiles are samples, not Agents. Id-only surfaces use AgentAvatarById, which reads the shared useAgents list and shows the id's character until it loads; the Agents page writes to the same cache.

Page icons for Agents (navigation entry, center tab) and the ghost of sub-agent tool calls are icons of a kind of thing and stay icons.

Flat glyph in coloured chips

bot/glyph.ts, BotGlyph in React: the body's path in the current colour, eyes cut through it. Outlines wind clockwise and the body's winding number under each eye is 1, so each eye is a counter-clockwise pill and nonzero fill cuts it out; a test checks every shape. Its view box fits the body by botFit.

It does not move, is cloned into the graph's SVG like a Solar icon, and takes the branch's colour (graph rendering). The main agent's glyph is the conversation Agent's character (useConversationAgentShape; an Agent with an upload or generated picture uses its id's character); a sub-agent's comes from its name.

The picker

The Agent editor's General section uses the profile's AvatarPicker with sources Character, Generated and Upload. Character shows shape tiles, previewing the current colour, and swatches. It edits the draft, so it saves and discards with the rest.

Sources and licences
SourceWhat it providesLicence
open-bot-avatar (npm, pinned)the renderer and 7 shapesMIT, Copyright Dominik Scholz
The same project's repository gallery15 more shapes, copied unchanged into components/avatar/bot/gallery.ts with the licence noticeMIT, Copyright Dominik Scholz
AlternativeWhy not
Renderers extracted from the Grok Bot client, and replicas of its charactersThe code or the character designs belong to xAI, whatever licence the repository states
@aora-bot/reactIts licence is not open source (attribution and team-size terms), and it needs React 19
agent-robot-avatarOne robot design whose character identity is reserved by its author
DiceBear Bottts, Facehash, animated emoji setsA different look from the one chosen: generated robots, letter faces, or emoji that do not read as one family

The shapes are the project's own designs.

Implementation status

Implemented. The happy mood is available to callers; no surface sets it yet.

Last updated · 2026-11-25