Repository navigation
fix(avatars): keep a template's shipped avatar instead of storing it as a default - #4754
Merged
Merged
Conversation
…as a default (#4750) A template-shipped image was stamped `is_default_avatar=1`, so Generate Default Avatars overwrote it and the Workspace showed initials (#4609). Both install paths (`local:` and `github:`) now stamp a file that was actually written with `set_avatar_identity` (=0), the writer the hub avatar already uses for a chosen image. A `local:` template that declares `avatar_prompt` but installs no file (none shipped, oversized, corrupt, barrier refusal) keeps today's default seed. `_install_bundled_avatar` now returns whether it wrote a file. Both installers re-encode before opening the destination, so a failed `optimize_avatar` no longer leaves a 0-byte `{name}.webp`. Red on c62030c before the fix: test_4750_bundled_avatar_installed_as_kept, test_4750_nonfatal_kept_stamp_failure, test_4570_github_bundled_avatar_is_stamped_as_kept, test_4570_github_bundled_avatar_without_prompt_still_stamped, and both test_4750_failed_reencode_leaves_no_empty_* (0-byte file present). No schema change. Agents created before this keep their =1 rows. Closes #4750 Closes #4609 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Flow doc: both install paths stamp a written file with set_avatar_identity, the prompt-only seed stays a default, the replace path is Generate or Delete (no upload; Regenerate 404s with no _ref.png), and agents created before the fix are not migrated, with a release-note line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… was written (#4750) `_install_bundled_avatar_bytes` now returns whether it wrote the file, like its `local:` twin, and the `github:` caller stamps the avatar as kept only on True. A destination the avatar store's path barrier refuses used to fall through to the stamp with no file on disk, handing the Workspace card a URL that 404s instead of showing initials (review note I2). Red before the fix: test_4750_refused_github_avatar_path_is_not_stamped (set_avatar_identity called once) and test_4750_github_installer_reports_whether_it_wrote (returned None). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rkspace card (#4750) test_4609_shipped_avatar_reaches_the_workspace_card drives create_agent_internal with a `local:` template that ships avatar.png. The harness's avatar writers are bound to the real facade over a tmp sqlite, so crud's own choice of writer lands in a real agent_ownership row, and the real portal roster then reads the card. The test never calls a writer itself (review note I1: the ent79 test stamps through set_avatar_identity directly and stays green with the fix reverted). Mutation: with crud.py reverted to c62030c this test goes red (`avatar_url` None: "shipped image shown as initials"); restored byte-identical, green. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
/validate-pr — APPROVERun
Mutation sweep on
|
vybe
marked this pull request as ready for review
November 24, 2026 10:32
trinity-ability
approved these changes
Nov 24, 2026
trinity-ability
left a comment
Contributor
There was a problem hiding this comment.
/validate-pr: APPROVE at head e84cb39. Re-ran the changed test files at head (green) and reverted the fix in a scratch worktree (red). Tier 1 green, dev-ci green.
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.
Closes #4750. Closes #4609. Independent PR on
dev. Draft until validated.What
src/backend/services/agent_service/crud.py). When alocal:orgithub:template shipsavatar.webp/avatar.pngand the file is installed, the agent's avatar is stored the way a chosen image is, not as a default. "Generate Default Avatars" leaves it alone, and the Workspace card shows it (bug(workspace): a GitHub template's bundled avatar still shows as initials in the Workspace #4609).docs/memory/feature-flows/agent-avatars.mdsays a shipped image is kept, how an owner replaces it, and what happens to existing agents.No schema change, no frontend change, no new endpoint.
Rulings carried (orchestrator, on the operator's behalf — plan file)
avatar_sourcecolumn).local:template that ships an image without anavatar_promptstill installs nothing: a follow-up, not this PR.Review + security
/review(Opus 5.5, report-only, a run that did not build it): MERGEABLE. Only two places read the flag (default generation and the Workspace card); nothing that depends on variant or reference files is switched on by it. Fixed after review in45b10b3b4(thegithub:installer returns whether it wrote; no stamp on a refused path) ande84cb3954(an end-to-end #4609 test through agent creation to the Workspace card, red with thecrud.pychange reverted). The enterprise module was grepped read-only: no reader breaks. Security: a manual pass over the diff, no finding; the full/csoskill was not run.Tests
test_1484_create_agent_characterization.py92,test_ent79_portal_exposure.py75,test_1173_hub_display_avatar.py13,test_ent1117_s8_path_barriers.py196, each file in its own process on the engineer. Known and not from this change:test_portal_token_roundtrip_and_fenceandtest_signin_verify_happy_pathfail ondevwhen the two changed files share a process (reproduced on the base, in file order and under seed 12345). Not run on the engineer: the full unit island and the repo-wide guard set; CI's run is the first full one.Before merge
Handoffs
Three follow-ups, texts kept by the orchestrator, not filed: a
local:template image withoutavatar_promptinstalls nothing; Regenerate answers 404 for a shipped image (no reference file); the avatar write is not atomic (a failed write can leave a truncated file).🤖 Generated with Claude Code