fix(desktop): keep channel-member agents mentionable without a local managed list - #3672
fix(desktop): keep channel-member agents mentionable without a local managed list#3672NachoG2000 wants to merge 1 commit into
Conversation
…managed list
The managed-list ghost-guard in useMentions.addCandidate ran before
shouldHideAgentFromMentions and dropped every agent identity not in the
local managed-agent list -- including relay-confirmed channel members
owned by other users. Since getMentionableAgentPubkeys seeds with
managedAgentPubkeys, any agent surviving the guard was already
"invocable", so shouldHideAgentFromMentions returned false on its first
branch, always: its documented member policy ("Option B") was
unreachable dead code.
Net effect: on an install with no locally managed agents, no agent was
mentionable at all -- not even one with respond_to "anyone". Hand-typed
agent names produced messages without a p tag (the typed-mention
fallback in extractMentionPubkeys draws from the same starved candidate
list), so harnesses never triggered. The mobile client implements the
same pipeline without the pre-gate and behaves correctly.
Exempt channel members from the guard so the member policy in
shouldHideAgentFromMentions actually decides. Non-member semantics
(ghost/stale identity filtering, hidden relay-only agents) are
unchanged. Add a channelBotMembers e2e seed modelling another owner's
member bot, a regression test pinning autocomplete visibility plus the
wire-level p tag, and update the prioritization test expectation that
pinned the buggy behavior (alice: channel member + respond_to "anyone"
directory agent, previously asserted hidden).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ignacio Garcia <igarcia@goempirical.com>
|
Tested head Verified in both lanes:
The behavior is correct. The foreign agent is no longer "Invisible." One repository gate blocks the PR:
Suggested fix: move the member-or-managed policy into Once the size gate is fixed, I found no behavioral or current-main compatibility blocker. |
|
Upsetting issue! hope this gets merged soon! |
|
this matches #4489 — dropping the local-managed-list gate for channel-member agents is the right direction. please keep a short note in the pr why local-only filtering was wrong for multi-install channels. |
Fixes #3671
Problem
On desktop, an agent owned by another user is never mentionable — even as a member of the same channel, even when the viewer is on its
respond_toallowlist. The managed-list guard inuseMentions.addCandidateruns beforeshouldHideAgentFromMentionsand drops every agent identity not in the local managed list. SincegetMentionableAgentPubkeysseeds withmanagedAgentPubkeys, every agent surviving the guard is already "invocable", soshouldHideAgentFromMentionsreturnsfalseon its first line, always — its documented member branch ("Option B": member + unknown invocability ⇒ show) is unreachable dead code. The mobile client implements the same pipeline without the pre-gate and behaves correctly; see the issue for the full analysis.Change
useMentions.ts: the managed-list ghost-guard now only applies to non-member candidates. Member-agent visibility is decided byshouldHideAgentFromMentions, which already encodes the intended policy (invocable ⇒ show; directory-present-but-excluding ⇒ hide; unknown ⇒ show).e2eBridge.ts/tests/helpers/bridge.ts: newchannelBotMembersmock seed — a channel member with rolebotthat is deliberately absent from the managed list, the kind:10100 directory, and profiles, i.e. exactly what another owner's agent looks like from this install.mentions.spec.ts: new regression test — with an empty managed list, a foreign member bot appears in the@dropdown (with the agent icon) and the signed event carries["p", <agent>], pinning the wire-level behavior. Verified to fail without the src change and pass with it.alice— a channel member and directory agent withrespond_to: "anyone"— as hidden. That expectation captured the regression itself (she is invocable and a member); she is now asserted visible.Not changed:
MembersSidebaradd-member search keeps the unfiltered guard — its candidates are non-members by construction. The pinned "relay-only agents stay hidden from channel mentions even when allowlisted" behavior is unchanged (those candidates are non-members).Testing
biome checkclean on the four touched files;tsc --noEmitclean.mentions.spec.ts, smoke project): all tests pass with this change except "groups member additions and joins with hidden names in the standard tooltip", which is flaky independently of this branch — it also fails intermittently (1 in 3 repeats) on unmodifiedorigin/mainon the same machine, and touches join system messages, not mention autocomplete.🤖 Generated with Claude Code