Skip to content

fix(desktop): admit the owner of an allowlist agent into mentions - #6284

Open
TheSeydiCharyyev wants to merge 1 commit into
block:mainfrom
TheSeydiCharyyev:fix/allowlist-owner-mentionable
Open

fix(desktop): admit the owner of an allowlist agent into mentions#6284
TheSeydiCharyyev wants to merge 1 commit into
block:mainfrom
TheSeydiCharyyev:fix/allowlist-owner-mentionable

Conversation

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor

Summary

relayAgentIsSharedWithUser resolves the owner in the owner-only branch, but reads respondToAllowlist literally in the allowlist branch. The harness accepts the owner in both modes — author_allowed ORs the explicit list with is_owner_or_sibling (crates/buzz-acp/src/lib.rs:249-257) — and the doc comment above it states that as the rule, not as an accident:

Both OwnerOnly and Allowlist accept the owner and same-owner siblings; Allowlist additionally accepts the explicit external pubkey list.

The two branches sit eight lines apart, so the effect is an inversion. Widening an agent's policy from owner-only to allowlist, to let one more person in, removes the agent from its own owner's picker. The agent still answers its owner, because the harness admits them, but the owner can no longer select it and a typed mention is never tagged. An allowlist with an empty array is hidden from everyone, the owner included, and nothing reports an error.

This adds the owner check to the allowlist branch. Two limits are deliberate:

Scope: getMentionableAgentPubkeys seeds from managedAgentPubkeys unconditionally, so agents this Desktop runs were never affected. The population this reaches is agents the viewer owns but runs elsewhere — headless agents, and agents on another machine.

The owner-only branch is left untouched. A shared helper for both branches was considered and left out: that path was rewritten last week by #6086, #6182 and #6224, and keeping the diff away from it avoids both a conflict surface and a refactor this fix does not need.

Related issue

Closes #6280.

Searched before opening. The nearest existing reports are both different:

Of the open PRs that touch agentAutocompleteEligibility.ts, none changes how the allowlist branch treats the owner. #2605 and #4204 are the only two that reach this area, and both target the cross-owner and owner-only paths.

Testing

Run in desktop on 93114c9c:

  • pnpm test5039/5039 (5037 before, plus the two added here)
  • pnpm typecheck — clean
  • pnpm check — clean

Red/green on the two new tests, through the project's own runner:

  • without the change — 31/33, and the two failures are exactly the new tests
  • with the change — 33/33

agentAutocompleteEligibility.test.mjs now covers an owner absent from the array, an empty array, a non-owner viewer (unchanged), an unresolved owner (denied), and relayAgentCanRespondInChannel still requiring channel membership for the owner.

No screenshot: the visible effect is one entry appearing in the existing @ list, and reproducing it needs a relay plus an agent running outside Desktop. The behaviour is pinned by the unit tests instead.

`relayAgentIsSharedWithUser` resolved the owner under `owner-only` but read
`respondToAllowlist` literally under `allowlist`. The harness accepts the owner
in both modes: `author_allowed` ORs the explicit list with `is_owner_or_sibling`,
and the doc comment on it states that as the rule rather than an accident.

The two branches sit eight lines apart, so the effect was an inversion. Widening
an agent's policy from `owner-only` to `allowlist`, to let one more person in,
removed the agent from its own owner's picker. The agent still answered its owner,
because the harness admits them, but the owner could no longer select it and a
typed mention was never tagged. An `allowlist` with an empty array was hidden from
everyone, the owner included, and nothing reported an error.

An owner that does not resolve still falls through to the list. On closed relays
the NIP-OA attestation frequently never materializes (block#4223, relay-side fix in
block#5581), and admitting on absence would expose the agent to every viewer.

`getMentionableAgentPubkeys` seeds from `managedAgentPubkeys` unconditionally, so
this never affected agents this Desktop runs. The population it reaches is agents
the viewer owns but runs elsewhere: headless agents, and agents on another machine.

The `owner-only` branch is left untouched. Sibling parity is not needed here:
`is_owner_or_sibling` also accepts same-owner sibling agents, but the picker's
`currentPubkey` is the human viewer.

Closes block#6280

Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
@TheSeydiCharyyev
TheSeydiCharyyev requested a review from a team as a code owner August 19, 2026 03:10
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.

Desktop: an agent on respond_to=allowlist is hidden from its own owner, while owner-only shows it

1 participant