Skip to content

fix: send x-auth-tag header in agent profile sync#522

Merged
tlongwell-block merged 1 commit into
mainfrom
fix/agent-profile-sync-auth-tag
May 11, 2026
Merged

fix: send x-auth-tag header in agent profile sync#522
tlongwell-block merged 1 commit into
mainfrom
fix/agent-profile-sync-auth-tag

Conversation

@tlongwell-block
Copy link
Copy Markdown
Collaborator

Problem

When User A creates a bot/agent, User B cannot see the bot's display name — it shows as a truncated pubkey hex. User A sees it fine.

Root Cause

sync_managed_agent_profile in desktop/src-tauri/src/relay.rs posts the agent's kind:0 profile event to the relay but never includes the x-auth-tag HTTP header. The relay's HTTP bridge checks membership via this header before parsing the event body. On a closed relay, the agent isn't a direct member, so without the header the POST is rejected with 403 — the kind:0 is never stored and display_name stays NULL.

The bot owner doesn't notice because the desktop client has a local fallback that injects display names from managedAgentsQuery (local agent records). Since this only returns the current user's agents, User A always sees names while User B falls through to truncated pubkey.

Fix

Add the x-auth-tag header to the HTTP request when auth_tag is available. The auth tag was already being passed into the function and embedded in the event body — it just wasn't being sent as an HTTP header for the relay's membership gate.

Review

  • Confirmed independently by Codex (GPT 5.5): traced the full call chain from sync_managed_agent_profile → relay bridge.rsenforce_relay_membership
  • Codex review scores: Minimalism 10/10, Elegance 9/10, Correctness 9/10, Overall 9/10

sync_managed_agent_profile posts the agent's kind:0 profile event to the
relay but was missing the x-auth-tag HTTP header. On closed relays, the
HTTP bridge checks membership via this header before parsing the event
body — without it, the POST is rejected with 403 and the agent's
display_name is never stored. This causes other users to see truncated
pubkey hex instead of the bot's display name.

The auth_tag (NIP-OA owner attestation) was already embedded inside the
kind:0 event body as a Nostr tag, and was already passed into the
function as a parameter — it just wasn't being sent as an HTTP header.
@tlongwell-block tlongwell-block merged commit 9e8302c into main May 11, 2026
15 checks passed
@tlongwell-block tlongwell-block deleted the fix/agent-profile-sync-auth-tag branch May 11, 2026 00:43
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