fix: send x-auth-tag header in agent profile sync#522
Merged
Conversation
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.
This was referenced May 28, 2026
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.
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_profileindesktop/src-tauri/src/relay.rsposts the agent's kind:0 profile event to the relay but never includes thex-auth-tagHTTP 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 anddisplay_namestays 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-tagheader to the HTTP request whenauth_tagis 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
sync_managed_agent_profile→ relaybridge.rs→enforce_relay_membership