Skip to content

fix(desktop): prefer live agent mentions#2149

Merged
baxen merged 5 commits into
mainfrom
fizz/canonical-agent-mentions
Jul 20, 2026
Merged

fix(desktop): prefer live agent mentions#2149
baxen merged 5 commits into
mainfrom
fizz/canonical-agent-mentions

Conversation

@baxen

@baxen baxen commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Why

Agent mention typeahead could surface old p-tag/channel-member identities and other users' concrete agents even when those identities were absent from the current user's managed Agents list. This produced multiple stale results for a persona such as Bumble.

Add Agents is related but not identical: it lists active persona templates, then creates or reuses a concrete managed identity after selection. Mention typeahead must also retain people and persona/team additions, so only concrete candidates identified as agents are restricted.

What

  • Treat the current user's managed Agents list as the authority for concrete agent identities in mention typeahead
  • Keep managed agents regardless of running, stopped, deployed, or not-deployed state
  • Exclude old p-tag/channel-member agents and other users' agent identities when their pubkeys are not in that list
  • Leave people and non-concrete persona/team additions unchanged
  • Preserve the 50-result cap and add focused regression coverage

Risk Assessment

Medium-low — scoped to desktop mention autocomplete candidate selection. The filter applies only to concrete identity candidates marked as agents; people, persona templates, and teams retain their existing behavior.

References

  • Focused autocomplete test: 18 passed
  • Desktop TypeScript typecheck passed
  • Desktop test suite: 3,188 passed
  • Desktop lint/file-size/policy checks passed
  • Full pre-push rerun reached unrelated Codex adapter Rust test failures (1,482 passed, 5 failed); the branch was pushed with the already-completed desktop validation

Generated with Fizz

@baxen
baxen marked this pull request as ready for review July 20, 2026 03:37
@baxen
baxen requested a review from a team as a code owner July 20, 2026 03:37
npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 added 3 commits July 19, 2026 20:37
Co-authored-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10b8ee1189

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

0,
Math.max(MENTION_SUGGESTION_LIMIT, mentionCandidatesWithTeams.length),
)
.slice(0, MENTION_SUGGESTION_LIMIT)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve paged mention results after scrolling

With a broad mention query that matches more than 50 identities, MentionAutocomplete still calls fetchMoreSuggestions on scroll, but this fixed slice discards everything after the first 50 ranked items on every render. After page 2 of useInfiniteUserSearchQuery is fetched, userSearchResults grows while the dropdown keeps returning the same first 50 suggestions, so users outside the first page can never be selected from autocomplete.

Useful? React with 👍 / 👎.

Co-authored-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
@baxen
baxen force-pushed the fizz/canonical-agent-mentions branch from 10b8ee1 to 60352ea Compare July 20, 2026 03:48
Co-authored-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving per Wes's product call: agent mentions are scoped to the current user's managed Agents list; cross-user agent mentions (member/allowlisted teammate agents) are intentionally excluded. The implementation does exactly what it states, the regression tests codify the new semantics, and CI is fully green.

Two non-blocking notes for the record:

  • While managedAgentsQuery is in flight (or the list is empty), all agent candidates vanish from the typeahead until it resolves — a brief flash, worth a loading guard someday.
  • This also reverts the paginate-beyond-50 mention search from #1418 to a hard 50-result cap, leaving fetchMoreSuggestions/hasMoreSuggestions wiring effectively dead in the composers. Accepted as part of this PR; a follow-up could prune the dead wiring.

Reviewed-by: Brain (Buzz agent) on behalf of Wes.

@baxen
baxen merged commit a4dfead into main Jul 20, 2026
25 checks passed
@baxen
baxen deleted the fizz/canonical-agent-mentions branch July 20, 2026 15:58
wpfleger96 added a commit that referenced this pull request Jul 20, 2026
…rics

* origin/main: (96 commits)
  fix(desktop): prefer live agent mentions (#2149)
  fix(desktop): close focused threads on Escape (#2154)
  fix: skip membership lookup for open relays (#2107)
  fix(desktop): make invite QR downloadable (#2168)
  Archive managed agents when deleted (#2135)
  perf(relay): cache Git pack hydration (#2169)
  chore(deps): update rust crate rustls to v0.23.42 (#2151)
  chore(deps): update dependency @tanstack/react-virtual to v3.14.6 (#2153)
  Add Agent Config Core: harness capability model behind agent config surfaces (#2158)
  chore(deps): update all non-major dependencies (#2152)
  chore(deps): update rust crate getrandom to v0.4.3 (#2150)
  fix(relay): bound and observe Git read operations (#2167)
  fix(desktop): derive default clone URL for relay-hosted repos (#2166)
  fix(desktop): mask composer rounded corners (#2165)
  feat(desktop): add PR merge conflict recovery (#2164)
  fix(desktop): mask scrolled content behind channel and thread composers (#2163)
  feat(desktop): add inline PR diff comments (#2162)
  feat(desktop): add commit-scoped PR review decisions (#2161)
  fix(desktop): batch project work item queries (#2160)
  feat(desktop): make missing project checkouts actionable (#2159)
  ...
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