Skip to content

fix(desktop): route same-owner remote agent mentions - #5484

Open
dafacto wants to merge 1 commit into
block:mainfrom
dafacto:fix/remote-owned-agent-mentions
Open

fix(desktop): route same-owner remote agent mentions#5484
dafacto wants to merge 1 commit into
block:mainfrom
dafacto:fix/remote-owned-agent-mentions

Conversation

@dafacto

@dafacto dafacto commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • make a same-owner remote agent mentionable from a stream or forum channel where that exact agent pubkey is already a member
  • route the existing remote pubkey without creating, starting, or adding a local managed-agent instance
  • preserve strict boundaries for DMs, community search, other-owned agents, and relay agents configured with respond_to: "nobody"
  • tolerate future relay response-mode strings without dropping the entire relay-agent directory

Root cause

The composer allow-list treated the local managed-agent store as the primary source of agent identity. On another Buzz client, a channel could contain an agent owned and hosted by the same user, but that client had no local managed record for the pubkey. The remote member was therefore filtered from autocomplete or could be confused with a local instance lifecycle.

This change treats verified NIP-OA ownership plus active channel membership as the remote routing signal, scoped only to channel composers. Admission waits for a successful relay-directory response so an explicit heartbeat-only policy cannot be missed during startup or directory errors.

User impact

A user can mention an agent hosted by another Buzz client in a shared stream or forum. Buzz sends the mention to the exact existing pubkey; local managed-agent setup remains untouched. Active Huddles reuse the existing remote-pubkey synchronization path.

Fixes #3277.

Validation

  • Claude peer review: LGTM WITH NITS after independent TypeScript, Biome, Rust, unit, and focused browser verification
  • desktop unit suite: 4,538 passed
  • desktop check, typecheck, file-size/style guards, and production/e2e builds passed
  • complete mentions smoke suite: 62 passed in the full run; its one pre-existing typing-space flake passed immediately in isolation (63/63 scenarios green)
  • focused Rust response-mode and future-mode compatibility tests passed; cargo fmt --check passed

Scope

This deliberately does not broaden direct-message or community-search agent discovery, and it does not make a remote identity a local managed instance.

Signed-off-by: dafacto <matt@dafacto.com>
@dafacto
dafacto marked this pull request as ready for review August 11, 2026 07:43
@dafacto
dafacto requested a review from a team as a code owner August 11, 2026 07:43
rmichelena added a commit to rmichelena/buzz that referenced this pull request Aug 14, 2026
…tries

An agent whose `respond_to` is `owner-only` — the harness default, so the
common case — is excluded by `relayAgentIsSharedWithUser` for everyone,
including the person the policy names as the only allowed sender. The
eligibility layer cannot fix that on its own: neither `RelayAgentInfo` nor
the TS `RelayAgent` carries an owner, so it has no way to ask whether the
viewer owns the agent.

`relay_enrich` already resolves each agent's NIP-OA owner from its kind:0
— it has to, to verify kind:30177 authorship before a record may seed or
override a directory entry. The owner was simply not exposed. This carries
it through to the frontend so an owner-aware admission branch (block#5484) has
the data without a second kind:0 round trip.

No eligibility behaviour changes here. `owner_pubkey` is populated and
otherwise unread, so the directory stays the only thing this PR alters.

`None`/`null` means unresolved, not unowned. On a closed relay the NIP-OA
owner frequently never materializes on the agent's kind:0 (block#4223, relay-side
fix in block#5581), and headless agents are exactly the population that runs
there — so a consumer must treat absence as "unknown" rather than as a
negative answer.

A test pins that the field serializes as `owner_pubkey`, not `ownerPubkey`:
the Tauri payload contract is snake_case and `fromRawRelayAgent` does the
camelCase mapping, so a rename would silently land `undefined` on the TS
side with nothing failing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Roberto Michelena <77797875+rmichelena@users.noreply.github.com>
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.

Managed agents are only mentionable from the machine that runs them

1 participant