fix: use relay-eligible agents for mention autocomplete - #4603
fix: use relay-eligible agents for mention autocomplete#4603auctobot001 wants to merge 1 commit into
Conversation
useMentions.ts filtered agent mention candidates through managedAgentPubkeys (agents locally managed by this device), instead of mentionableAgentPubkeys (agents eligible via relay directory + allowlist). This means an agent only shows up in another device's @-mention autocomplete if that device happens to locally manage it — even when the agent is a published relay-directory entry and that device's identity is allowlisted to message it. Swap to mentionableAgentPubkeys, which already accounts for relay directory + allowlist eligibility and is the correct source for this lookup. managedAgentPubkeys is no longer read in this useMemo body, so it's dropped from the dependency array.
|
We hit this exact bug from a different angle than the multi-device scenario described above — a fully remote agent with no managed-agents entry on any desktop:
This also means the "Option B" logic inside We've cherry-picked this diff onto |
|
Heads-up from a parallel investigation on #5363, in case it's useful here. The We opened #5483 with a data-layer fix: merge Not a claim that this PR is wrong — the two layers are compatible — just that the eligibility change alone may not be reproducibly verifiable against relay-published agents. Full analysis in #5363. |
Summary
useMentions.tsfiltered agent candidates for @-mention autocomplete throughmanagedAgentPubkeys— the set of agents locally managed by the current device — instead ofmentionableAgentPubkeys, which already accounts for relay-directory + allowlist eligibility.kind:30177) and channel membership.isAgentIdentityInManagedListcheck frommanagedAgentPubkeystomentionableAgentPubkeys.managedAgentPubkeyswas then unused in thatuseMemo, so it's dropped from the dependency array (flagged by the exhaustive-deps lint).Test plan
pnpm typecheck— cleanpnpm exec biome checkon the changed file — cleanpnpm test— all 3870 unit tests pass