Repository navigation
feat(avatars): preset pickers for humans AND agents; deprecate AI generation - #1061
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viagetAvatarSrc, which means:Avatar,V2Avatar) renders picks with zero per-component changesLegacy color values keep rendering for users who have them; they're simply no longer offered.
Agent avatars — owner-editable (Sam: "if created by someone")
PUT /api/agent-profile/:agentName/:instanceId?/avatarallows an admin or the installer of an active installation — nobody else (403, no store touched).GET …/avatar/can-editpowers the UI affordance; the backend stays the real gate.bottts:<seed>presets or uploaded-image refs only.bigsmile:on an agent, data URIs, andjavascript:all 400.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.iconUrlso Your-Team cards can't drift from the profile.The deprecation — both buttons
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