Skip to content

fix(desktop): show shared invocable agents in mentions - #4242

Open
bluestonetrust wants to merge 5 commits into
block:mainfrom
bluestonetrust:fix/shared-agent-channel-mentions
Open

fix(desktop): show shared invocable agents in mentions#4242
bluestonetrust wants to merge 5 commits into
block:mainfrom
bluestonetrust:fix/shared-agent-channel-mentions

Conversation

@bluestonetrust

@bluestonetrust bluestonetrust commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • show shared relay agents in mention autocomplete only when they advertise the exact active stream or forum and their respond_to policy permits the current viewer
  • keep DMs, unresolved channel types, new-message recipients, and project-agent pickers fail closed for other-owned relay agents
  • revalidate cached autocomplete rows when channel or relay policy changes
  • prevent relay-directory identities from reappearing as ordinary people through global search
  • preserve picker-selected outbound Nostr p tags and forum mention support

Root cause

Desktop treated relay-agent eligibility as profile-wide. An allowlisted agent could be suggested without belonging to the active channel, while an anyone agent could be suggested because it overlapped some other joined channel. That exposed identities and advertised actions that ACP would not dispatch.

Security and privacy

The picker now requires all of these for an other-owned relay agent:

  1. the composer is for a known stream or forum
  2. the agent's channel_ids contains that exact channel
  3. respond_to is anyone, or the current viewer is explicitly allowlisted

DMs remain managed-only because ACP's DM author gate permits only the owner or same-owner sibling agents. Cached suggestions are rechecked against current eligible candidates before display.

Validation

  • pnpm test: 3,905 passed, 0 failed
  • pnpm check: passed
  • pnpm build: passed
  • pnpm build:e2e: passed
  • playwright tests/e2e/mentions.spec.ts: 54 passed
  • new-message relay misclassification regression: passed
  • targeted exact-channel, cross-channel, DM, unresolved-type, stale-cache, forum, and outbound p-tag coverage: passed
  • independent privacy and correctness review: approved, with one non-blocking future test-coverage suggestion
  • local aarch64-apple-darwin Tauri app bundle: built successfully

Fixes #3971

Originating Buzz channel: 1e408238-c672-4d83-ab5c-25ff3f7401eb

Khanh Le added 4 commits August 2, 2026 13:37
Include relay agents that the current user can invoke through a shared channel or allowlist while continuing to hide unavailable agent identities. Keep duplicate agent entries coalesced and cover the picker and outbound mention flow with unit and browser tests.

Co-authored-by: Khanh Le <bluestonetrust04@gmail.com>
Signed-off-by: Khanh Le <bluestonetrust04@gmail.com>
Co-authored-by: Khanh Le <bluestonetrust04@gmail.com>
Signed-off-by: Khanh Le <bluestonetrust04@gmail.com>
Co-authored-by: Khanh Le <bluestonetrust04@gmail.com>
Signed-off-by: Khanh Le <bluestonetrust04@gmail.com>
Pass the known forum channel type only from forum-backed composers so other ForumComposer reuse stays fail closed. Strengthen the DM and unresolved-state browser controls and cover relay-only forum autocomplete.

Co-authored-by: Khanh Le <bluestonetrust04@gmail.com>
Signed-off-by: Khanh Le <bluestonetrust04@gmail.com>
@bluestonetrust
bluestonetrust marked this pull request as ready for review August 2, 2026 04:20
@bluestonetrust
bluestonetrust requested a review from a team as a code owner August 2, 2026 04:20
@bluestonetrust
bluestonetrust marked this pull request as draft August 3, 2026 05:06
Require relay agents to be invocable in the exact stream or forum being composed. Keep DMs and context-free pickers fail closed, revalidate cached suggestions, and prevent relay identities from reappearing as people.

Co-authored-by: OpenAI <support@openai.com>
Signed-off-by: Khanh Le <bluestonetrust04@gmail.com>
@bluestonetrust
bluestonetrust marked this pull request as ready for review August 3, 2026 05:42
wesbillman added a commit that referenced this pull request Aug 5, 2026
## Summary

- admit relay-discovered agents to autocomplete when their response
policy authorizes the viewer
- require authorization in the exact active stream/forum channel for
mentions, while keeping community-wide discovery for member invitation
- fail closed for relay-only agents in DMs and unresolved composer
contexts
- re-authorize cached autocomplete rows after policy/channel changes so
stale agent suggestions cannot leak back in
- preserve managed-agent behavior and explicitly reject stale
agent-marked channel members absent from both live directories

## Validation

- `pnpm --dir desktop test` — 4,288 passed
- `pnpm --dir desktop typecheck`
- `pnpm --dir desktop check`
- `pnpm --dir desktop build:e2e`
- focused Playwright mention matrix — 12 passed
- focused Playwright member-invitation matrix — 2 passed
- pre-push hooks after rebase to current `origin/main` — desktop check
and 4,288 tests passed
- independent correctness/privacy re-review cleared with no remaining
blocker

## Related competing PRs

This supersedes or overlaps #2333, #3056, #4242, #4137, #2314, #4058,
and #2605. This version adds exact-channel authorization, fail-closed
DM/context handling, cached-row reauthorization, forum coverage,
outbound mention-tag coverage, explicit stale-member coverage, and
add-member discovery coverage.

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
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.

Mention autocomplete never offers remotely-hosted agents (shared relay agent eligibility is unreachable)

1 participant