Skip to content

fix(desktop): preserve authoritative agent avatars - #4984

Merged
tellaho merged 2 commits into
mainfrom
tho/agent-avatar-authority
Aug 7, 2026
Merged

fix(desktop): preserve authoritative agent avatars#4984
tellaho merged 2 commits into
mainfrom
tho/agent-avatar-authority

Conversation

@tellaho

@tellaho tellaho commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Category: fix
User Impact: Agent cards and catalog listings now show the avatar belonging to the identity they represent.

Problem: Running agent cards could show a stale definition avatar instead of the concrete agent profile, while adding another publisher's catalog entry could let local edits repaint that publisher's listing. This made agent identity look inconsistent across My Agents and the Agent Catalog.

Solution: Treat the concrete agent pubkey profile as authoritative for running-card avatars, with the linked definition as fallback. Keep relay publications authoritative for foreign catalog presentation while using local copies only for linkage and selection state.

before after
Screenshot 2026-08-06 at 3 48 43 PM Screenshot 2026-08-06 at 3 48 40 PM
agent-set avatar not showing agent-set avatar is showing

Changes

File changes

desktop/src/features/agents/lib/agentCardAvatar.ts
Adds the explicit avatar precedence rule for running agent cards and blocks avatar-dependent actions until the authoritative profile query settles.

desktop/src/features/agents/lib/agentCardAvatar.test.mjs
Covers profile precedence, definition fallback, blank avatar handling, and the profile-loading transition for linked-agent actions.

desktop/src/features/agents/lib/personaCatalogRelay.ts
Keeps publisher-provided catalog identity and behavior fields authoritative after a local copy is added.

desktop/src/features/agents/lib/personaCatalogRelay.test.mjs
Verifies local copies contribute linkage and selection without overriding publisher presentation.

desktop/src/features/agents/ui/UnifiedAgentsSection.tsx
Uses the concrete agent profile avatar before the linked definition avatar on running-agent cards.

Reproduction Steps

Running agent card uses the agent profile avatar

Use two visibly different, publicly reachable image URLs: A for the saved definition and B for the running agent profile.

  1. In Settings → Experiments, enable Agent-managed profiles. This prevents Desktop from restoring the definition avatar over an agent's own relay-profile changes.
  2. In Agents, create an agent with image A as its avatar and start it.
  3. In a channel containing that agent, ask it to update its own Buzz profile avatar to image B. The exact CLI operation under the agent identity is buzz users set-profile --avatar <image-B-url>.
  4. After the agent confirms the update, reopen Agents → My Agents (or reload the page so its kind:0 profile is fetched again).
  5. Verify the running agent card shows image B, not definition image A. Open ⋯ → Share and verify the share flow also uses image B.

Before this fix, the My Agents card and share flow preferred image A whenever the linked definition had an avatar.

Catalog listing remains publisher-authoritative

This scenario requires a second Buzz identity so the entry is foreign to the account under test.

  1. As the publisher identity, create an agent definition with a distinctive name, avatar, and instructions, then use Share → Share to catalog.
  2. As the test identity, open Agents → Discover agents, find that publication, and add it.
  3. In My Agents, open the added copy's ⋯ → Edit, change its name, avatar, and instructions, and save.
  4. Return to Discover agents and find the same publisher entry.
  5. Verify it remains selected/added but still shows the publisher's original name, avatar, and instructions—not the test identity's local edits.

Validation

  • pnpm test — 4,376 passed
  • pnpm typecheck — passed
  • pnpm check — passed with existing non-error notices

@tellaho
tellaho force-pushed the tho/agent-avatar-authority branch from 2d4e0bf to abe9adb Compare August 6, 2026 00:33
@tellaho
tellaho marked this pull request as ready for review August 6, 2026 01:48
@tellaho
tellaho requested a review from a team as a code owner August 6, 2026 01:48
@tellaho
tellaho force-pushed the tho/agent-avatar-authority branch from abe9adb to 9a9f79b Compare August 6, 2026 02:03
tellaho added 2 commits August 5, 2026 19:03
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho force-pushed the tho/agent-avatar-authority branch from 9a9f79b to 7647d7d Compare August 6, 2026 02:08

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 7647d7d813a98223373c977f89e9036af4c90ddd on Wes Billman's behalf.

No blocking findings. I traced the running-card avatar path through the concrete pubkey profile query, fallback resolution, and avatar-dependent Share/Export action gating; the profile remains authoritative once resolved while an absent/blank profile picture falls back to the linked definition. I also traced foreign catalog projection and activation: relay publication fields now remain authoritative for presentation, while the local copy contributes only its linkage id and active/selected state, and Add correctly reuses/reactivates that copy rather than minting another.

The focused unit coverage pins precedence, blank handling, loading behavior, foreign-copy provenance, and publisher-authoritative presentation. A clean merge tree against current origin/main (1399ec1d13c4560f50fd947e504deeea70929751) is conflict-free and preserves the newer runtime-control work. All CI checks reported for the reviewed head are green.

This is a technical review comment, not an approval; approval remains Wes's decision.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 7647d7d813a98223373c977f89e9036af4c90ddd adversarially. No blocking findings.

I traced both authority boundaries end to end:

  • Linked cards resolve the selected concrete agent's kind:0 avatar before the definition fallback, and avatar-dependent Share is held until the profile query settles, preventing a fallback avatar from being snapshotted during initial loading.
  • Catalog projections retain only the local copy's linkage id and active state; publisher-controlled display name, avatar, prompt, runtime/model/provider, name pool, and behavior remain sourced from the relay publication. The add flow still resolves the local copy by publisher/persona coordinates and avoids duplicate copies.

I also checked the conflict-free merge tree against current origin/main (1399ec1d13c4560f50fd947e504deeea70929751). Existing focused tests cover precedence, blank/missing fallback, loading-state gating, and foreign catalog authority; CI is green at the reviewed head.

@tellaho
tellaho merged commit f03de21 into main Aug 7, 2026
26 checks passed
@tellaho
tellaho deleted the tho/agent-avatar-authority branch August 7, 2026 00:14
tlongwell-block pushed a commit that referenced this pull request Aug 7, 2026
Absorbs the relay half that shipped separately in #5133 (squash commit
ad92335): the kind:30179 ingest acceptance hunk in
crates/buzz-relay/src/handlers/ingest.rs was byte-identical on both
sides, so this merge removes all relay-side changes from this PR's
diff. #4999 now carries only the desktop + buzz-core codec half.

No rebase, no force-push — history preserved per operator instruction.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>

* origin/main:
  fix(bench): mention the orchestrator by pubkey when posting the task (#5136)
  feat(relay): accept kind:30179 private managed-agent events at ingest (#5133)
  fix(media): require authenticated reads (#4610)
  fix(desktop): preserve authoritative agent avatars (#4984)
  fix(desktop): next/back navigation during key creation onboarding (#4978)
  Alert community owners and admins when a new key joins (#4900)
  fix(desktop): prevent sidebar prefs from reverting on stale-localStorage boot (#5086)
  chore(hooks): run desktop typecheck in pre-push (#5110)
  feat(identity): recover desktop identity from a signed-in phone (#4845)
  fix(buzz-agent): classify read timeouts distinctly in LLM error messages (#4959)
  Refine agent runtime controls (#5026)
  test(desktop): await thread scroll anchor (#3174)
  Improve desktop mobile pairing flow (#5024)
  feat(desktop): show selected community in rail (#5000)
  fix(desktop): stop rate-limited reconnect backfill from tearing down the authenticated socket (#4990)
  fix(desktop): skip native notifications outside app bundles (#5004)
  ci: prove the relay-driven mesh lifecycle — discover, join, infer, deny — with real nodes (#3862)
  fix(desktop): virtualize channel member lists (#4991)

Signed-off-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz>
bradseiler added a commit that referenced this pull request Aug 7, 2026
…igration

* origin/main:
  fix(bench): mention the orchestrator by pubkey when posting the task (#5136)
  feat(relay): accept kind:30179 private managed-agent events at ingest (#5133)
  fix(media): require authenticated reads (#4610)
  fix(desktop): preserve authoritative agent avatars (#4984)
  fix(desktop): next/back navigation during key creation onboarding (#4978)
  Alert community owners and admins when a new key joins (#4900)
  fix(desktop): prevent sidebar prefs from reverting on stale-localStorage boot (#5086)
  chore(hooks): run desktop typecheck in pre-push (#5110)
  feat(identity): recover desktop identity from a signed-in phone (#4845)
  fix(buzz-agent): classify read timeouts distinctly in LLM error messages (#4959)
  Refine agent runtime controls (#5026)
  test(desktop): await thread scroll anchor (#3174)
  Improve desktop mobile pairing flow (#5024)
  feat(desktop): show selected community in rail (#5000)
  fix(desktop): stop rate-limited reconnect backfill from tearing down the authenticated socket (#4990)
  fix(desktop): skip native notifications outside app bundles (#5004)
  ci: prove the relay-driven mesh lifecycle — discover, join, infer, deny — with real nodes (#3862)

Signed-off-by: Brad Seiler <seiler@squareup.com>

# Conflicts:
#	deploy/charts/buzz/templates/deployment.yaml
#	deploy/charts/buzz/tests/render_test.yaml
#	deploy/charts/buzz/values.schema.json
#	deploy/charts/buzz/values.yaml
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.

2 participants