Skip to content

feat(avatars): preset pickers for humans AND agents; deprecate AI generation - #1061

Merged
lilyshen0722 merged 9 commits into
mainfrom
feat/face-preset-picker-deprecate-ai-avatars
Aug 21, 2026
Merged

lilyshen0722 merged 9 commits into
mainfrom
feat/face-preset-picker-deprecate-ai-avatars

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Sam's ruling: users pick their avatar from a preset of generated faces (or upload); the AI-generation feature is deprecated. Extended mid-flight with the second half: agents created by someone are avatar-editable by that someone.

The picker (humans)

Eight deterministic bigSmile faces, seeded off the user's own identity — so the grid is personal and never reshuffles between visits. A picker whose options change reads as broken, and "the face I picked last month" must still be in the grid when they return. That property has a test.

The storage scheme is the design

profilePicture = 'bigsmile:<seed>' (humans) / 'bottts:<seed>' (agents) — a seed, not image bytes or a URL. Every renderer regenerates the exact character locally via getAvatarSrc, which means:

  • nothing 404s, expires, or needs hosting
  • every existing consumer (v1 Avatar, V2Avatar) renders picks with zero per-component changes
  • the round-trip is pinned: what the picker showed is byte-identical to what every surface renders

Legacy color values keep rendering for users who have them; they're simply no longer offered.

Agent avatars — owner-editable (Sam: "if created by someone")

  • Gate is creation-shaped: PUT /api/agent-profile/:agentName/:instanceId?/avatar allows an admin or the installer of an active installation — nobody else (403, no store touched). GET …/avatar/can-edit powers the UI affordance; the backend stays the real gate.
  • Scheme-validated: bottts:<seed> presets or uploaded-image refs only. bigsmile: on an agent, data URIs, and javascript: all 400.
  • Three surfaces move atomically: Mongo User.profilePicture (source of truth) → PG mirror via the one sanctioned door, syncUserToPostgreSQL (fire-and-log — the July half-write incident is why; if Retire the PG users mirror? — four drift incidents, one hot-path trade #1062 retires the mirror this endpoint stays correct unchanged) → AgentRegistry.iconUrl so Your-Team cards can't drift from the profile.
  • UI: the agent profile hero grows an "Edit avatar" affordance for installer/admin — eight deterministic robots seeded off the agent's identity, same grid every visit.
  • 8 backend tests pin gate + write order + validation + mirror-failure tolerance.

The deprecation — both buttons

  • UserProfile "Generate with AI" — button, dialog, state, handler: gone.
  • AgentsHub "🎨 Generate AI Avatar" (agent creation) — gone. Agents get deterministic bottts by identity; the AI path bought a worse version of what already exists, for API spend. Upload stays on both surfaces — Commonly Support's hand-made C icon is the case for it.

Backend agentAvatarService (OpenAI/Gemini) is left in place this pass — publish-flow scripts reference it; removing it rides the next registry cleanup rather than this UI deprecation.

Why presets beat generation, in one line from this week's evidence: deterministic and local means install #10,000 costs what install #1 did, the same face renders forever, and there is no provider credential to silently die for seven weeks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

…ture

Sam's ruling: users select from generated presets or upload; AI generation is
deprecated. The stored value is a SEED, not image bytes or a URL — every
renderer regenerates the exact face locally, so nothing 404s, expires, or
needs hosting, and getAvatarSrc resolving the scheme means every existing
consumer (v1 Avatar, V2Avatar) renders picks with zero per-component changes.

presetFaceOptions seeds the eight-face grid off the user's identity so the
grid is personal and never reshuffles — a picker whose options change between
visits reads as broken, and the face picked last month must still be there.
The dialog now offers exactly what Sam specified: eight deterministic bigSmile
faces plus Upload. The AI generator button, its dialog, state and handler are
gone from this surface. Legacy color values keep RENDERING for users who have
them; they are simply no longer offered.
Agents get deterministic bottts by identity, so the AI generator here bought a
worse version of what already exists for API spend. Upload stays for the
hand-made-icon case (Commonly Support's C is one).
The grid never reshuffles, different users get different grids, a stored pick
round-trips to the exact chosen face, the scheme cannot collide with legacy
color ids or URLs, and legacy colors still render for users who have them.
…e: and bottts:

Agents join the picked-avatar scheme: presetCharacterOptions(seedBase, kind)
yields the eight-option grid for either species, and getAvatarSrc resolves
both prefixes, so a picked robot renders on every surface (chat, cards,
profile) through the exact same code path as a picked face.
…atar

Sam's ruling: agents created by someone are editable by that someone. The gate
is creation-shaped — admin, or installer of an ACTIVE installation. Accepts
bottts:<seed> presets or uploaded-image refs; raw AI generation stays
deprecated. Writes Mongo User first, mirrors through the one sanctioned door
(syncUserToPostgreSQL, fire-and-log — the July half-write incident is why),
and moves AgentRegistry.iconUrl in the same request so the Your-Team cards
cannot drift from the profile. GET .../avatar/can-edit powers the affordance.
Installer yes / stranger 403 (no store touched) / admin yes; scheme validation
rejects bigsmile, data URIs and javascript:; upload refs accepted; 404 when no
bot User matches; PG-mirror failure does not fail the request (Mongo is the
source of truth); can-edit reports the same verdict the write path enforces.
can-edit decides whether the affordance renders; the backend stays the real
gate. The dialog offers eight deterministic robots seeded off the agent's
identity (same grid every visit) — picks are stored as seeds and regenerated
locally everywhere. Hooks sit above the loading/error early returns.
Anchored to the hero card; accent-bordered selection, focus-visible state,
disabled-while-saving. All colors via v2 tokens so both themes hold.
@lilyshen0722 lilyshen0722 changed the title feat(avatars): face-preset picker; deprecate AI avatar generation feat(avatars): preset pickers for humans AND agents; deprecate AI generation Aug 21, 2026
@lilyshen0722
lilyshen0722 merged commit 25d83a9 into main Aug 21, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the feat/face-preset-picker-deprecate-ai-avatars branch August 21, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant