fix(desktop): let channel-member agents reach the mention picker - #5760
fix(desktop): let channel-member agents reach the mention picker#5760auditt98 wants to merge 1 commit into
Conversation
d61ce16 to
100a7b1
Compare
`useMentions.addCandidate` ran two agent-admission gates in sequence:
`isAgentIdentityInAllowedList` first, then `shouldHideAgentFromMentions`.
The first is strictly harsher — it rejects every agent absent from
`mentionableAgentPubkeys`. That made the second's "member with unknown
invocability => show" branch unreachable, even though that branch is
deliberate ("Option B") and has its own passing unit test.
The unreachable branch is exactly the case that matters in a shared
community: an agent owned by another install is a channel member, but its
invocability cannot be established, because nothing in-tree publishes the
kind:10100 agent-profile entry that `getMentionableAgentPubkeys` reads.
`relayAgentsQuery` therefore comes back without it, the agent never enters
`mentionableAgentPubkeys`, and the allow-list gate drops it before the
fallback can admit it.
Result today: an agent is mentionable only by its owner, whose own client
seeds `mentionableAgentPubkeys` from local disk and never consults the
relay directory at all. Every other member sees nothing, whatever
`respond_to` is set to. Reported repeatedly — block#4548, block#3776, block#2603, block#3277,
block#3809, block#4489, block#4776.
Drop the redundant gate so `shouldHideAgentFromMentions` is the single
admission policy, matching the module's documented intent, and add a truth
table locking the relationship the two functions have: they agree
everywhere except directory-less members, where the allow-list check was
wrong.
Note the intended trade-off, unchanged from Option B's design: a member
agent whose invocability is unknown is now shown optimistically, so a
mention may still be dropped by the harness if `respond_to` excludes the
sender. Showing it is what lets the sender discover the agent at all.
Signed-off-by: Your Real Name <the-email-on-your-github-account>
100a7b1 to
14fb911
Compare
|
I reviewed and ran the focused suite at Two blockers:
Contribution hygiene also needs repair: the commit trailer contains the placeholder Our remote Hermes/Fly fleet is a good acceptance target once those points are resolved. I can then verify: remote channel member visible to a non-owner client, selection emits the exact |
|
The useful boundary here is identity discovery versus invocation authority. A channel member marked as an agent should be discoverable and mentionable from every client. Emitting its I would keep this PR narrow: extract the production candidate-admission composition and prove a directory-less member is admitted, a directory-present excluded member stays hidden, and selecting the remote identity emits its exact The new same-owner reproduction on #2349 exposes the adjacent case this does not settle: a directory-present |
Chessing234
left a comment
There was a problem hiding this comment.
heads up, main moved under this one yesterday. #5681 (bcf353c, 13 aug) rewrote both files — 212/84 across agentAutocompleteEligibility.ts and useMentions.ts. the isAgentIdentityInAllowedList call this deletes is already gone from useMentions.addCandidate on main; shouldHideAgentFromMentions at :257 is the only admission call left there.
it also reshaped that function: on main it takes ownerOnly/directoryReady and forwards to getAgentMentionAdmission, and doesn't take isMember or directoryAgentPubkeys at all. so the new truth table won't survive a rebase — two of its columns aren't parameters any more, and with ownerOnly absent every isAgent row comes back "unknown", i.e. hidden.
probably worth re-checking whether the original complaint still reproduces on current main before reworking the test; the admission model there is different enough that the answer may have moved.
|
Closing. Rebasing onto current main shows #5681 already removed this gate and replaced it with an explicit fail-closed getAgentMentionAdmission, so the optimistic policy this PR argued for was decided against upstream. Thanks for the reviews! |
useMentions.addCandidateran two agent-admission gates in sequence:isAgentIdentityInAllowedListfirst, thenshouldHideAgentFromMentions.The first is strictly harsher — it rejects every agent absent from
mentionableAgentPubkeys. That made the second's "member with unknown invocability => show" branch unreachable, even though that branch is deliberate ("Option B") and has its own passing unit test.The unreachable branch is exactly the case that matters in a shared community: an agent owned by another install is a channel member, but its invocability cannot be established, because nothing in-tree publishes the kind:10100 agent-profile entry that
getMentionableAgentPubkeysreads.relayAgentsQuerytherefore comes back without it, the agent never entersmentionableAgentPubkeys, and the allow-list gate drops it before the fallback can admit it.Result today: an agent is mentionable only by its owner, whose own client seeds
mentionableAgentPubkeysfrom local disk and never consults the relay directory at all. Every other member sees nothing, whateverrespond_tois set to. Reported repeatedly — #4548, #3776, #2603, #3277, #3809, #4489, #4776.Drop the redundant gate so
shouldHideAgentFromMentionsis the single admission policy, matching the module's documented intent, and add a truth table locking the relationship the two functions have: they agree everywhere except directory-less members, where the allow-list check was wrong.Note the intended trade-off, unchanged from Option B's design: a member agent whose invocability is unknown is now shown optimistically, so a mention may still be dropped by the harness if
respond_toexcludes the sender. Showing it is what lets the sender discover the agent at all.Summary
Related issue
Testing