Files
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6wandTaylor Ho 462d2190a5 fix(desktop): detect owned agents via kind:0 OA-owner signal in profile panel
Owned agents rendered as humans in the profile panel's archive flow: the
Archive button + confirm modal showed the human variant even for an agent
the viewer owns (repro: tho's agent Edna).

Root cause: two gates disagreed. The archive button's canArchive gate
resolves correctly via OA-ownership, but the human-vs-agent framing used a
separate signal — isBot = Boolean(relayAgent || managedAgent) — that checks
the relay-agents registry + the local managed-agents list. An owned agent
deployed elsewhere can miss BOTH lists, so isBot was false and the panel
rendered the human framing while the button still showed.

Fix: OR in the kind:0-derived agent flag (isAgent on the users-batch
summary, which the backend sets from profile_has_valid_oa_owner — a verified
NIP-OA auth tag on the target's kind:0). That's the same authoritative
signal the archive gate's resolveOaOwner trusts, so isBot can no longer
drift from the gate. Client-only change, no relay/registry change.

- UserProfilePanel: query useUsersBatchQuery([pubkey]) and OR its isAgent
  into isBot (keyed by lowercased pubkey, matching the house pattern).
- BotIdenticon: forward an optional data-testid to its wrapper.
- UserProfilePanelSections: tag the profile bot indicator with
  data-testid=profile-bot-indicator for the regression test.
- profile.spec.ts: regression test — an owned agent seeded with the kind:0
  agent flag but absent from relay/managed lists now renders agent framing.

Pre-existing, unrelated: profile.spec.ts 'updates the relay-backed profile
from settings' fails on clean origin/main too (avatar-url assertion) — not
touched by this change.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
2026-06-14 13:23:31 -07:00
..