Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ export function getMentionableAgentPubkeys({
export function isAgentIdentityInManagedList(
candidate: { isAgent?: boolean; pubkey: string },
managedAgentPubkeys: ReadonlySet<string>,
mentionableAgentPubkeys?: ReadonlySet<string>,
) {
const pubkey = normalizePubkey(candidate.pubkey);
return (
candidate.isAgent !== true ||
managedAgentPubkeys.has(normalizePubkey(candidate.pubkey))
managedAgentPubkeys.has(pubkey) ||
// Externally-hosted agents (relay directory, kind:10100) that are
// invocable for the current user are legitimate mention targets even
// though no local managed-agent record exists for them.
(mentionableAgentPubkeys?.has(pubkey) ?? false)
);
}

Expand Down
8 changes: 7 additions & 1 deletion desktop/src/features/messages/lib/useMentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,13 @@ export function useMentions(
if (isArchivedDiscovery(pubkey)) {
return;
}
if (!isAgentIdentityInManagedList(candidate, managedAgentPubkeys)) {
if (
!isAgentIdentityInManagedList(
candidate,
managedAgentPubkeys,
mentionableAgentPubkeys,
)
) {
return;
}
if (
Expand Down