Skip to content

fix(desktop): resolve mentions from channel members [issue:#3204] - #3906

Open
tcballard wants to merge 2 commits into
block:mainfrom
tcballard:tcballard/channel-member-mention-resolution
Open

fix(desktop): resolve mentions from channel members [issue:#3204]#3906
tcballard wants to merge 2 commits into
block:mainfrom
tcballard:tcballard/channel-member-mention-resolution

Conversation

@tcballard

Copy link
Copy Markdown

Summary

Implements issue #3204 as the next separate contribution in the #3863 handoff workstream.

The mention picker was applying a local-managed-agent gate to every agent candidate, including agents already present in the current channel. That made a remote or otherwise non-local channel member impossible to mention, while unrelated local persona rows could appear instead.

Scope

Included

  • Removes the local-managed-agent requirement from channel-member mention candidates.
  • Keeps the existing invocability and archived-identity checks for non-member agent candidates.
  • Preserves channel membership on the candidate, so a channel-member agent is not labeled “not in channel” and can be selected with the correct pubkey.
  • Adds a focused E2E regression covering a profile-backed agent that is a member of #general but is not locally managed.

Excluded

Product / Architecture Decisions

  • Channel membership remains the authoritative source for candidates already in the open channel.
  • Local managed agents and explicitly invocable relay agents retain their existing non-member behavior.
  • Existing duplicate-name disambiguation, profile labels, archived filtering, and p-tag extraction are reused unchanged.

User-Facing Contract

In a channel composer, @ now offers agent identities that are current members of that channel even when their runtime is hosted on another machine or is not represented in this Desktop’s local managed-agent list. Those rows are shown as channel members rather than “not in channel.” Non-member, non-invocable agent rows remain hidden.

Verification

Ran

  • Focused Biome check on useMentions.ts and mentions.spec.ts
  • node --import ./test-loader.mjs --experimental-strip-types --test src/features/agents/lib/agentAutocompleteEligibility.test.mjs (18 passed)
  • git diff --check

Added

  • desktop/tests/e2e/mentions.spec.ts: channel-member, non-local agent is visible and not labeled “not in channel.”

The full Playwright browser run and TypeScript build were attempted but could not complete in this environment because the temporary checkout’s Vite/Node dependency loader stalled while reading vite.config.ts; this is an environment/toolchain limitation, not a test assertion failure.

UI Evidence

This changes autocomplete behavior, not layout or styling. A screenshot/recording could not be captured because the local browser build was blocked by the dependency-loader issue described above; the regression is represented in the focused E2E spec for maintainers to run in CI.

Review Path

  1. desktop/src/features/messages/lib/useMentions.ts
  2. desktop/tests/e2e/mentions.spec.ts

Notes For Reviewer

This is an independent branch and PR, not stacked on the workflow-history or Canvas-history contributions. It deliberately does not address the adjacent persona duplication, DM recipient, or command-palette workstreams.

@tcballard
tcballard requested a review from a team as a code owner July 31, 2026 11:10
@Chessing234

Copy link
Copy Markdown
Contributor

nice narrow fix. worth a regression case where the channel member is respond_to:allowlist but the viewer is not on the list — autocomplete should still hide them.

Verify channel-member agents stay hidden from autocomplete when the viewer is outside their respond_to allowlist.

Signed-off-by: Tom Ballard <tom@armytage.co>
@tcballard

Copy link
Copy Markdown
Author

@Chessing234 Added this in ba6650a. The regression seeds mira as a #general channel member with respond_to: allowlist, leaves the mock viewer off the allowlist, and asserts that @mi autocomplete stays hidden. The focused Playwright test passes (1 passed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants