fix(desktop): let channel members bypass mention agent gate#965
Open
tellaho wants to merge 1 commit into
Open
Conversation
a4905d6 to
0bf3cb4
Compare
Collaborator
Author
|
checks fixed by #966 |
PR #942 added a directory-wide gate that hides any agent from the mention autocomplete unless it lives in the running build's `managed-agents.json` or advertises `respondTo === "anyone"` on the relay. The intent — keeping the relay's zombie zoo out of autocomplete — is right for the global directory, but the gate is also applied to agents that are already explicit channel members. That hides: - the user's own agents owned by a different build (prod vs. dev/worktree split — each build has its own `managed-agents.json`) - channel-added bots that defaulted to `respondTo: "owner-only"` Explicit channel membership is itself an opt-in signal, so let those candidates through unconditionally and keep the directory gate for non-members and `userSearchQuery` hits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0bf3cb4 to
cbd8bf0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: fix
User Impact: Agents that are already members of a channel reappear in
@-mention autocomplete, even when they live in a different build'smanaged-agents.jsonor were set torespondTo: owner-only.Problem: PR #942 added a global gate that hides any agent from the mention picker unless the running build owns it locally or it advertises
respondTo: "anyone". The intent — keeping the relay's long tail of non-responsive bots out of the picker — is right, but the same gate was applied to bots that are already explicit channel members. Across multiple builds (prod, dev, worktrees) each Tauri instance has its ownmanaged-agents.jsonkeyed by bundle identifier, so the same persona lives behind different pubkeys per build and only one build "owns" each pubkey. The result was that my canonical Ned/Bart/Marge agents stopped autocompleting in channels they're members of whenever I ran from a different build.Solution: Treat channel membership as its own opt-in signal. Members bypass the directory gate; non-members and global-search hits still go through it, so the zombie zoo stays hidden.
File changes
desktop/src/features/messages/lib/useMentions.ts
Adjusted the agent gate in
addCandidateso it only fires for non-members (!candidate.isMember). Membership is only ever set by the channel-members loop — directory and global-search candidates are hard-codedisMember: false— so the bypass can't be triggered by relay discovery results. The archived-identity filter runs before this gate, so archived agents stay hidden even when they're members.Reproduction steps
managed-agents.jsondoes NOT contain the canonical Ned pubkey owned by your prod build.respondTo: "owner-only").@n.@nin a channel where Ned is not a member: Ned should still NOT appear (directory gate intact).