Skip to content

refactor(avatars): drop orphaned app-avatar: symbolic-ref machinery#1235

Merged
tellaho merged 1 commit into
kennylopez-agent-avatar-plumbingfrom
tho/drop-orphaned-app-avatar-refs
Jun 24, 2026
Merged

refactor(avatars): drop orphaned app-avatar: symbolic-ref machinery#1235
tellaho merged 1 commit into
kennylopez-agent-avatar-plumbingfrom
tho/drop-orphaned-app-avatar-refs

Conversation

@tellaho

@tellaho tellaho commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Overview

Category: improvement
User Impact: No user-facing change — this removes dead internal plumbing for an avatar feature that was never finished, keeping the codebase honest.

Problem: The app-avatar:<id> symbolic pointer was meant to power curated, selectable avatar sets — letting users pick an agent avatar by symbolic ID instead of baking in one-off URLs. That's the right primitive, but the resolver half was never built / was removed in #1132 (the goose-set collections). What survived was only the parsing + plumbing half: parseGooseAppAvatarId was only ever called by its own validators, and there's no id→image map anywhere in the tree. The machinery stored and round-tripped an ID that nothing could render — a half-bridge to nowhere that added two special-case branches for a capability that doesn't ship.

Solution: Remove the orphaned parsing/plumbing module and collapse its two call sites back to their simple paths. The live persistable-URL import branch is preserved byte-for-byte, so real avatar URLs are untouched; only the dead symbolic-ref handling is dropped. The generic avatar_ref Rust field stays — it's an opaque carrier of real URLs, not specific to app-avatar:.

This spike grew out of the #1202 avatar-plumbing review.

Changes

File changes

desktop/src/shared/avatars/gooseAppAvatarRefs.ts
Deleted the entire parser/validators module (parseGooseAppAvatarId, isGooseAppAvatarRef, toGooseAppAvatarRef). It was an orphan — only ever called by its own validators, with no resolver anywhere to turn an ID into an image.

desktop/src/shared/avatars/gooseAppAvatarRefs.test.mjs
Deleted alongside the module it covered.

desktop/src/features/profile/hooks.ts
Collapsed the skip-fetch guard from isGooseAppAvatarRef(url) ? null : getAvatarSnapshotUrl(url) to a plain getAvatarSnapshotUrl(url). Symbolic refs no longer dodge the snapshot path — nothing ships them anymore, so there's no live regression.

desktop/src/features/agents/ui/personaDialogState.ts
Inlined a local resolveImportedPersonaAvatarUrl + isPersistableAvatarUrl. The persistable-URL branch is byte-for-byte identical to the old module (same [avatarRef, avatarDataUrl] precedence, same ^(?:https?:|data:image/|blob:) regex). Only the dead toGooseAppAvatarRef keep-as-is branch is gone; symbolic refs now drop instead of round-trip — intended, since nothing renders them.

desktop/src-tauri/src/commands/personas.rs
Retired the dead app-avatar: vocabulary in test fixtures (swapped to plain https URLs). Parser behavior unchanged — avatar_ref stays an opaque passthrough of the avatar: frontmatter value.

desktop/src-tauri/src/managed_agents/persona_card_tests.rs
Swapped app-avatar: fixtures to plain https URLs and renamed dead-term tests. The avatar_ref field is retained as a generic opaque carrier (it holds real URLs).

Reproduction Steps

  1. Check out tho/drop-orphaned-app-avatar-refs (based on kennylopez-agent-avatar-plumbing).
  2. Grep the tree for app-avatar / GooseAppAvatar — confirm zero residual references.
  3. Run the desktop suite (desktop-test, typecheck, lint) and Rust suite (rust-tests, desktop-tauri-test) — all green.
  4. Exercise persona import with a real http(s): / data:image/ / blob: avatar URL — it's preserved exactly as before. A persona carrying a symbolic app-avatar:<id> ref now drops the ref (no renderer existed for it).

Re-adding later

See #1132 for the breadcrumb. When selectable avatar sets land, the resolver + id→image registry + picker UI get rebuilt alongside this plumbing.

+43 / −142 across 6 files.

The app-avatar:<id> symbolic pointer was meant to power curated,
selectable avatar sets — users pick an agent avatar by symbolic ID
instead of baking in one-off URLs. But the resolver half was never
built / was removed in #1132 (the goose-set collections). What
survived was only the parsing + plumbing half: parseGooseAppAvatarId
was only ever called by its own validators, and no id->image map
existed anywhere. The machinery stored and round-tripped an ID that
nothing could render.

This removes that orphaned plumbing:
- delete the gooseAppAvatarRefs module (parser + validators + tests)
- collapse the profile/hooks.ts skip-fetch guard to a plain snapshot
- inline personaDialogState.ts import resolution to keep persistable
  http(s):/data:/blob: URLs only (byte-for-byte identical branch;
  symbolic refs now drop instead of round-trip — intended, nothing
  renders them)
- retire the dead app-avatar: vocabulary in Rust test fixtures

The Rust avatar_ref field stays: it is a generic opaque carrier of the
avatar: frontmatter value (it holds real URLs), not specific to
app-avatar:.

See #1132 for the breadcrumb to re-add selectable avatar sets — that is
where the resolver + picker UI should be rebuilt alongside this plumbing.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho tellaho marked this pull request as ready for review June 24, 2026 06:47
@tellaho tellaho merged commit 9a19c2d into kennylopez-agent-avatar-plumbing Jun 24, 2026
20 checks passed
@tellaho tellaho deleted the tho/drop-orphaned-app-avatar-refs branch June 24, 2026 06:50
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