Skip to content

fix(mentions): put your own agents first when the query starts their name - #2482

Open
loganj wants to merge 3 commits into
mainfrom
loganj/mention-own-agents-first
Open

loganj wants to merge 3 commits into
mainfrom
loganj/mention-own-agents-first

Conversation

@loganj

@loganj loganj commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🤖

Summary

  • When you type @sol in a direct message, your own agent named Sol 6 now comes first. Before, the menu listed every agent called Sol from the community directory ahead of yours, so you had to type a longer, unique name (or add a personal prefix to your agents' names) to find your own.
  • Other people's agents with the same name now show their owner (Sam’s Sol, Wes’s Sol) even when their owner's profile was not loaded yet. Before, some showed only a short key suffix.
  • Your own agents are now offered in direct messages. Choosing one names it in the message; it does not add the agent to the DM.

Details

  • New lead rule (mention rules section 4 rule 3, contract version 4). Inside each group (members first, then outside choices), a choice leads when:

    • it is a person whose name is exactly the query, or
    • it is one of your agents whose name is the query or starts with the query followed by a new word: Sol 6 and Sol-6 lead for sol, and Sol 6.1 High leads for sol 6. Solana and kylez Sol 6 do not lead.

    An exact-name person still ranks above your agents. Membership still ranks first: a channel member always ranks above an outside choice, and your agents from another community still rank below this community's choices, because choosing one starts a cross-community join.

  • Only a choice whose shown label matches the query can lead, and only its own names decide it. A hidden alias, a key suffix or a generated owner prefix (tho’s Rizz) never makes a row lead.

  • What counts as yours: an agent you saved or host (here or in another community), or one whose signed profile carries an owner claim that verifies to you (the same check "Managed by" uses). An owner claim that does not verify only labels the agent (Wes’s Sol); it never moves the agent up, so another agent cannot claim you to rank first.

  • Profiles read for directory agents. The menu reads the owner profiles that directory results name, and the profile of each directory agent that claims you, so that claim can be verified. A verified agent leads from the next query, because rows already shown stay in place. The menu reads them again if the profile cache evicts them or a read is cancelled while the menu is open.

  • Menu stability. Rows already shown stay in place. Your agents that load after the menu opens are added at the end, like other late results.

  • The portable contract (src/bundled/mentions/README.md) and its shared fixtures are updated to version 4, with cases for each rule above. Version 4 combines this rule with the exact public key rule that main added as version 3.

  • Out of scope: Command-K search, the New message picker and the add-member dialog use a separate ranking that also weighs your recent picks. They are not changed here.

@loganj
loganj marked this pull request as ready for review November 4, 2026 21:28
@loganj
loganj requested a review from a team as a code owner November 4, 2026 21:28
wesbillman

This comment was marked as resolved.

@loganj

This comment has been minimized.

@loganj
loganj force-pushed the loganj/mention-own-agents-first branch from 9eb9260 to 1dfe8ce Compare November 6, 2026 04:36

@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.

🤖 Star Lord’s automated source follow-up via Wes’s account, with independent Rocket, Mantis and Groot coverage.

No new actionable findings at head 1dfe8ce59629c4e6a42c4c029c8fe93a246cd0e2 / base 8bd102f215027965fa45d673e9918f628cb9b495. Preserving the earlier review at 9eb9260e00464688bc3d41dc029304c436dd401f, this pass checked the rebased feature’s integration with capped ranking, append-only admission, name-preference aliases and profile loading. Ownership promotion and block ordering occur before the row cap; Space selection still uses the uncapped candidates. The prior description wording note is resolved.

Source inspection only: no tests, builds or app execution were run. Live DM behavior, preference switching, focus/recovery, cache timing and performance remain unverified. COMMENT review, not approval.

@tellaho

tellaho commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🤖 Drip design review at 1dfe8ce59629c4e6a42c4c029c8fe93a246cd0e2: no must-fix UX findings. Your matching agent is easier to find within its membership/community group, displayed rows stay in place as results load, and DM outsiders retain the explicit “Will not be notified” detail.

Source inspection only; no screenshots, tests or app execution. Themes, widths, long names, enlarged text, keyboard/focus, real cache timing and DM delivery remain unverified.

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Rebase integration finding; no new runtime or security defect observed in this head.

loganj and others added 3 commits November 7, 2026 17:00
…name

In a DM, `@sol` found every Sol agent through the directory search. The
viewer's own agents were not offered there, a directory row that names
the viewer as owner did not count as theirs, and another person's agent
named exactly `Sol` ranked above the viewer's `Sol 6`. An owner the
client had not cached also left namesakes with key suffixes.

- Rank a leading choice first within its group (mention rules section 4
  rule 3, contract version 3): a person whose name is the query, or one
  of the viewer's agents whose name is the query or continues it with a
  new word (`Sol 6` for `sol`, not `Solana` or `kylez Sol 6`). Only a
  choice whose shown label matches can lead, and only its own names
  decide it, so hidden names and generated owner prefixes never lead.
  Exact people still lead the viewer's agents, and members still lead
  outside choices.
- Count an agent as the viewer's when it is a saved or hosted agent here
  or in another community, or its profile or directory row names the
  viewer as owner. Keep directory rows whose declared owner the member
  profile lacks.
- Offer the viewer's agents in a DM, as outside choices that are named
  but not notified, and append the ones that load after the menu opens.
- Read the declared owners of directory agents, so namesakes get
  `Wes’s Sol` and not a key suffix. Read them again after an eviction or
  a cancelled read.

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An agent's profile names its owner with an auth tag that the profile
cache parses but does not verify. Ownership now makes an agent lead, so
an agent could claim the viewer as owner and rank first with no owner
prefix. An agent is now the viewer's when it is a saved or hosted agent,
or when its verified owner (the attestation "Managed by" uses) is the
viewer. An unverified claim still qualifies namesake labels.

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A directory-only agent that names the viewer as owner had no cached
profile, so its owner could never be verified and it never led. The
menu now reads that agent's profile in the background with the owner
profiles it already reads. Once verified, the agent leads from the next
query; installed rows still never move.

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@loganj
loganj force-pushed the loganj/mention-own-agents-first branch from 1dfe8ce to 43261ce Compare November 7, 2026 22:02
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.

5 participants