Repository navigation
feat(members): default headless crew-create to a name-seeded icon - #22644
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The change stores a default only when no avatar was given, leaves existing crews alone, and pins Python–frontend parity to the frontend source and the Notes
[DESIGN-REVIEWED] 146d639 Description read[DESCRIPTION-READ] 6499c957928a87eb35fa0c65b97a19daef47d6ac631a05316333dfaa03f0d49d That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix is justified by #20865. The issue is its size: 265 lines rebuild DiceBear's random-number generator draw for draw in Python, and that exact parity has no consumer. Notes
What this change shipsInventory (7 items) — 5 justifiedIntent: a crewmate created without picking an avatar shows a name-seeded icon whichever way it was created. FIX (#20865).
[FIRST-PRINCIPLES-REVIEWED] 146d639 Description read[DESCRIPTION-READ] 437e1b687c0309d88a664de8d866131499e287298eb7386ecba83d449ea45e6f That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
2f9434f to
ac9d863
Compare
3334263 to
09ce65a
Compare
|
Moved the |
09ce65a to
906102e
Compare
|
Backend Tests shard 4 ( This is a pre-existing failure on |
906102e to
558d844
Compare
|
Rebased onto main cd15d80 to clear the merge conflict in crew_records.py (main added start_template_refusal beside this PR's default-icon block; both kept). Diff unchanged otherwise; CI re-running. |
A new crewmate created through the UI gets a name-seeded icon avatar (#20392), but one created headlessly (POST /api/agents with no avatar, or `kirocrew agent create`) stored an empty override and rendered the trait ghost #20392 is retiring. Apply the same default server-side at the shared create point so every path lands on the same icon. A new module crew_avatar_seed.py reproduces the frontend's DiceBear-seeded pick (avatarPoses.ts, @dicebear/core 9.4.3) exactly -- the PRNG, the UTF-16 seed hashing, and the draw sequence createAvatar makes before the pose/bg pick -- so a given name yields the same icon the UI previews. Both create paths apply default_icon_avatar(display_name or name) only when no avatar was supplied; an explicit avatar is never overridden.
558d844 to
146d639
Compare
|
Fixed the Backend Lint red on 558d844: the file-line cap (dashboard/handlers/agents.py at 2,001 lines, cap 2,000). The re-export line this PR added there is gone; crew_records.py imports default_icon_avatar locally instead, matching the start_template_refusal import beside it. Coverage Gate was only downstream of that lint failure. Also rebased onto main 0085b1c (none of the new commits touch this PR's files). New head 146d639; CI re-running. |
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
Approving at 146d639.
This closes the remaining gap from #20392: a mate created without an avatar through POST /api/agents, kirocrew agent create, the first-crewmate bootstrap or the auto-improvement app was still born the name's ghost, while the UI path already gave it a name-seeded icon. All four now store the same {kind: icon, pose, bg} the UI would pick for that name. An explicitly sent avatar, including an explicit ghost reset, is kept. Main does not have this yet, and avatarPoses.ts has not moved since the base, so the parity table still holds.
Checked: dropping the explicit-ghost-reset guard in crew_records.py reddens test_explicit_ghost_reset_is_not_replaced_by_the_icon (both parameters).
Worth knowing: because the first-crewmate bootstrap is included, every new install's first mate now starts as an icon instead of a ghost.
Non-blocking follow-ups:
docs/system-specs/modules/crew-mode.mddescribes the name-seeded icon default only for the New mate dialog. Please add the headless create paths and the explicit-ghost-reset exception.- The Python PRNG port means any change to the pose list, the palette or the
@dicebear/coreversion needs a matching change increw_avatar_seed.py.test_crew_avatar_seed.pywill fail until that is done, which is the right guard. A one-line note inavatarPoses.tspointing at the Python mirror would save the next editor a surprise.
iamwhatever
left a comment
There was a problem hiding this comment.
Approve at 146d639.
A crewmate created without an avatar through POST /api/agents, kirocrew agent create, the first-crewmate bootstrap or the auto-improvement app now stores the same name-seeded icon the UI would pick. An explicit avatar, including an explicit ghost reset, is kept, and an invalid one is still refused (crew_records.py#L543). avatarPoses.ts and the @dicebear/core 9.4.3 pin are unchanged on current main, so the parity table still holds. Checks are green and the branch merges cleanly. Note that every new install's first crewmate now starts as an icon.
AI findings judged non-blocking
- Design note: a
{kind: icon}marker would avoid the Python port. This is an optional alternative, andtest_crew_avatar_seed.pyfails if the two generators drift (crew_avatar_seed.py#L256). - First Principles items 6 and 7: exact DiceBear parity and the version-pin test are oversized. That is a size and maintenance preference; the port is deterministic and cannot crash on any name.
I read the diff, the tests and CI results; I did not run anything locally.
— crew-pr-reviewer (r138)
Problem / Motivation
Goal: A crewmate created without choosing an avatar shows a name-seeded icon, whichever way it was created.
A crewmate made in the UI already gets a name-seeded icon (#20392). One made headlessly —
POST /api/agentswith noavatar, orkirocrew agent create— stored an empty avatar and rendered the trait "ghostface" #20392 is retiring. So today the default face depends on how the crew was created.Why it matters
#20392 promised that a crewmate born without an explicit pick is an icon, never a ghost the user did not choose (#18616). That promise only held for the two UI paths; a crew made by CLI or a direct API call was still born a ghost.
Not a goal
What changed (motivation → approach → change)
A headless create stored an empty avatar, which the renderer falls back to as the name's ghost. The fix defaults the avatar from one shared helper, so every create path lands on the same icon the UI posts for that name.
The approach is parity, not a lookalike: the icon must be the same one the UI previews for a given name, and the UI derives it through
@dicebear/core's seeded PRNG inwebsite/src/lib/avatarPoses.ts. A new backend module,crew_avatar_seed.py, reproduces that generator exactly — the PRNG, the UTF-16 seed hashing (so an emoji name hashes as its surrogate pair, as in the browser), and the sequence of drawscreateAvatarmakes before the pose/background pick — and tolerates the out-of-range index a max-valued draw yields (as the frontend's?? fallbackdoes) so no name crashes. A test pins the result name-for-name against the real frontend and pins the@dicebear/coreversion, so a dependency bump that moves the pick fails the test.Every
create=Truepath then appliesdefault_icon_avatar(name)when no avatar was supplied: the raw API (dashboard/agent_admin/crew_records.py, importing the helper locally because it runs in the agents facade's injected namespace), the CLI (cli_commands_agent.py), the first-crewmate bootstrap (agent_materialization/first_crewmate.py), and the auto-improvement app's role provisioning (apps/builtins/auto_improvement/backend/crew.py). An explicitly supplied avatar is never overridden — including an explicit ghost reset, which collapses to an empty override but is a deliberate choice of the name-derived ghost. Seeding from the shown name (display_name or key) matches what the roster draws.Backwards compatibility
Compatible: only an ABSENT avatar on create is affected — it changes from an empty override (which drew the ghost) to a name-seeded icon. An explicitly supplied avatar of any kind is passed through unchanged, and existing crews are not touched.
Removes nothing: no field, path, record or capability is removed; this adds a default where there was none.
Tests
test/test_crew_avatar_seed.py— pins the backend seeding to the real frontend output name-for-name (a frozen table captured from@dicebear/core9.4.3 across ASCII, case, CJK, accented, an astral emoji, trimmed whitespace and a long name); asserts determinism and the exact{kind, pose, bg}shape; provespickfalls back rather than crashes on the out-of-range index a max-valued draw yields; reads the pose list, palette, defaults and the pinned@dicebear/coreversion back out of the frontend source so a changed art set or a version bump fails the test and forces a re-sync.test/test_api_agents_create_template.py— a no-avatarPOST /api/agentsstores the name-seeded icon (never an empty override); an explicit icon, ghost, or ghost-reset avatar is not overridden; a free-form name seeds from its shown label.test/test_cli_agent.py—kirocrew agent createstores the same name-seeded icon, including seeding a free-form name from its display label.Manual verification
N/A — unit coverage pins the stored default on both headless paths and its parity with the frontend; nothing renders differently that the existing avatar tests do not already cover.
Related Issues
Fixes #20865