Summary
The desktop composer prevents a user from mentioning an agent owned by someone else even when the agent is present in the channel and its respond_to policy explicitly permits that user.
Observed in wss://formidable.communities.buzz.xyz:
- Testbot is owned by
gabimoncha.
- Testbot is a
bot member of #general.
- Testbot is configured so Pax may invoke it.
- Gabimoncha can resolve and mention Testbot.
- Pax's
@Testbot remains plain text and the published event has no Testbot p tag, so ACP is never woken.
Root cause
PR #2149 made the current user's local managed-agent list authoritative for every concrete agent identity in mention autocomplete.
useMentions.ts calls isAgentIdentityInManagedList(candidate, managedAgentPubkeys) before the existing respond_to/allowlist/shared-channel eligibility check. An other-owned agent is therefore discarded even when getMentionableAgentPubkeys() has correctly classified it as invocable for the current user.
This conflates two different concepts:
- managed by me — ownership/lifecycle control
- invocable by me —
owner-only, allowlist, or anyone response policy
Expected behavior
A concrete agent should be mentionable when either:
- it is locally managed by the current user, or
- its relay profile and channel relationship authorize the current user through
respond_to.
Agents that are neither locally managed nor invocable must remain hidden.
Acceptance criteria
- An allowlisted user can select an other-owned agent from desktop
@mention autocomplete.
- An
anyone agent shared through a joined channel can be selected by other members.
- The sent event contains the selected agent's
p tag.
- Owner-only and non-allowlisted other-owned agents remain hidden.
- Locally managed agents remain visible regardless of response policy.
- Focused unit and desktop E2E coverage protects the owner/allowlist distinction.
Suspected files
desktop/src/features/messages/lib/useMentions.ts
desktop/src/features/agents/lib/agentAutocompleteEligibility.ts
desktop/src/features/agents/lib/agentAutocompleteEligibility.test.mjs
desktop/tests/e2e/mentions.spec.ts
Regression introduced by #2149.
Summary
The desktop composer prevents a user from mentioning an agent owned by someone else even when the agent is present in the channel and its
respond_topolicy explicitly permits that user.Observed in
wss://formidable.communities.buzz.xyz:gabimoncha.botmember of#general.@Testbotremains plain text and the published event has no Testbotptag, so ACP is never woken.Root cause
PR #2149 made the current user's local managed-agent list authoritative for every concrete agent identity in mention autocomplete.
useMentions.tscallsisAgentIdentityInManagedList(candidate, managedAgentPubkeys)before the existingrespond_to/allowlist/shared-channel eligibility check. An other-owned agent is therefore discarded even whengetMentionableAgentPubkeys()has correctly classified it as invocable for the current user.This conflates two different concepts:
owner-only,allowlist, oranyoneresponse policyExpected behavior
A concrete agent should be mentionable when either:
respond_to.Agents that are neither locally managed nor invocable must remain hidden.
Acceptance criteria
@mentionautocomplete.anyoneagent shared through a joined channel can be selected by other members.ptag.Suspected files
desktop/src/features/messages/lib/useMentions.tsdesktop/src/features/agents/lib/agentAutocompleteEligibility.tsdesktop/src/features/agents/lib/agentAutocompleteEligibility.test.mjsdesktop/tests/e2e/mentions.spec.tsRegression introduced by #2149.