fix(desktop): show eligible cross-owner channel agents in @ mentions - #3816
fix(desktop): show eligible cross-owner channel agents in @ mentions#3816CExKEze wants to merge 2 commits into
Conversation
Channel-member agents were dropped by the local managed-list gate before shouldHideAgentFromMentions could apply respond_to / shared-channel eligibility, so teammates could not @-mention agents they do not personally manage. Pass channel members through once the relay directory is ready and keep non-members on the managed-list gate. Signed-off-by: Kachi Eze <keze@caseiq.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Kachi Eze <keze@caseiq.com>
CExKEze
left a comment
There was a problem hiding this comment.
Front-End / UX review (Shuri-Lex)
Scope reviewed: Desktop mention autocomplete path only — agentAutocompleteEligibility.ts, useMentions.ts, eligibility unit tests, mentions.spec.ts e2e flip. Smoke screenshot from the channel thread.
Overall: No blockers. The fix restores the intended UX for #3809: eligible cross-owner channel bots appear in @ with the generic agent label (not “managed by you”, not “not in channel”), while invocability still funnels through shouldHideAgentFromMentions. Scope stayed on the mention path — MembersSidebar still uses isAgentIdentityInManagedList.
Confidence: High
What looks right
- Reachability → invocability chain is the right product order; managed-list no longer dead-ends cross-owner members.
- Loading gate avoids a false-positive flash of owner-only/allowlist-excluded bots while the directory is in flight.
- Option B (ready + empty/errored directory → show unknown members) is the safer UX degradation than indefinite hide.
- Smoke evidence matches expected labels:
alice=agent; managed agents keepagent managed by you. - E2E expectation flip for alice correctly encodes the bug class rather than papering over it.
Non-blocking notes
- Comment nit in
isAgentIdentityReachableForMentions: “members stay hidden” while loading is slightly loose — humans still pass viaisAgentIdentityInManagedList; only unmanaged agent members are withheld. Worth tightening if you touch the comment again. - When the directory flips to ready, eligible cross-owner agents can appear mid-open autocomplete (list growth). Acceptable tradeoff vs flashing ineligible agents; no a11y live-region needed for this PR.
No accessibility or visual-system regressions introduced by this change. Leaving adversarial / correctness gate to Nick-Lex.
|
Adversarial review pass — no blocking defects found. One behavioural consequence worth recording for maintainers, since it is not visible from the diff alone. Directory-absent member bots are now offered.
So a bot that publishes a directory entry excluding the viewer is hidden, while a bot that publishes nothing at all is offered. #3809's Expected asks for agents "that the viewer is allowed to invoke ( I do not think this should change in this PR. Tightening it would re-break #3809 whenever the relay directory is incomplete, and it grants no new capability — the issue notes that an explicit Verified independently at Note for CI: the workflow run for this PR concluded |
…lete The block#3809 e2e now expects the cross-owner member agent visible; pin her position ahead of Fizz so the member-before-persona invariant covers her. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Kachi Eze <keze@caseiq.com> Signed-off-by: Kachi Eze <keze@caseiq.com>
|
this is the right fix for #3809. can you also note in the test that relay-only non-members stay hidden so that regression is pinned? |
|
Thanks — agreed on pinning relay-only / non-member stay-hidden. That regression is already covered in this tip (
So the deliberate narrowing is: channel-member path opens for eligible cross-owner bots; non-member relay-directory agents stay out of the composer. Happy to rename/comment those tests for clearer discoverability in a tiny follow-up after CI has run on this tip — holding commits for now so we don’t re-queue the first-contributor workflow approval. |
Summary
Desktop
@-mention autocomplete dropped cross-owner channel-member agents becauseuseMentionsfiltered onisAgentIdentityInManagedList(local install only) beforeshouldHideAgentFromMentions/relayAgentIsSharedWithUsercould run.This change lets channel-member agents through the managed-list gate once the relay agent directory is ready, then keeps
shouldHideAgentFromMentionsas the single invocability decision. Non-member relay-directory agents stay on the managed-list gate (preservesmentions.spec.ts“relay-only agents stay hidden…” policy / #3809 Expected = channel members).Fixes #3809
Buzz channel:
7eeeb66d-80cc-4680-87c6-0d38d8d25624Related issue
What changed
isAgentIdentityReachableForMentions— member pass-through only whenrelayAgentDirectoryReady(reuses existing predicate inuseMentions.ts; no new readiness predicate).shouldOfferAgentIdentityForMentions— production chain (reachability →shouldHideAgentFromMentions) so tests cannot drift from a hand-rolled mirror; also keepsuseMentions.tsunder the 1000-line file-size ratchet (996 lines; base onorigin/mainwas 999).alice(default mock relay agent, member ofgeneral,respond_to: anyone, not managed by the install) now expected visible with agent icon.Scope / no-widening
rg isAgentIdentityInManagedList desktop/src→ production call sites are onlyuseMentions.tsandMembersSidebar.tsx. This PR changes the mention path only. Lookalikes (useClassifiedMembers,useSearchResults,useNewMessageRecipients,ProjectsAgentPromptPage) build their own sets / import other helpers and do not take the new function.Out of scope: harness author gate, mobile/web clients,
respond_tosemantics, non-member relay-directory broadening,linux_media.rsmacOS clippy noise.Testing
Attributed commit:
4e032f7d546b5f9f82fe0b4bd2051ddc782fc270linux_media.rs(pre-existing; reference at line 86 inside linux-onlyenable_media_capture). Authoritative evidence: this PR’s GHAdesktop-core→ Desktop Tauri clippy onubuntu-latest.channel_detail_page_test.dart:1053); zeromobile/**in diff; GHA Mobile job path-filtered out for this change.Also: eligibility unit suite 24 pass;
mentions.spec.ts49 pass including relay-only hidden policy at:829.Second-identity smoke (recorded steps + screenshot)
At
4e032f7d5, e2e bridge install manages onlycharlie; types@in#general:aliceappears with agent label (not “managed by you”, not “not in channel”) —SMOKE_ALICE_COUNT=1Screenshots: attached in issue/PR thread from
.scratch/3809-smoke/(cross-owner-alice-dropdown.png).Dual-frame review notes (Nick-Lex / Shuri-Lex)
mentions.spec.tsrelay-only policy. Mission “and relay-directory” wording is narrowed to members only — recorded here so it is not silent.shouldHideAgentFromMentions(untouched). Made live for unmanaged agents by this PR. Not tightened here — would re-break Desktop @-mention autocomplete only shows locally managed agents #3809 when the directory is incomplete; recommend a follow-up issue if product wants “no entry ⇒ hidden.”