You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mobile): @ in an agent chat shows what each agent is for - #48302
When you type @ in an agent chat on the phone, each agent in the list now says what it's for, the same "For: …" line the desktop shows. You can also find an agent by typing a word from what it's for.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
7
$\color{#1a7f37}{\Huge{\mathbf{+}}}$59
$\color{#cf222e}{\Huge{\mathbf{−}}}$15
$\color{#1a7f37}{\Huge{\mathbf{+}}}$44
What Changed
Before: the phone's @ list showed each agent's name and nothing else, unless it was paused or the chat's own agent. Typing a word from an agent's purpose found nothing.
After: each agent row has a one-line subtitle, "For: ", using the desktop's string (components.native-chat.composer.botFor). A paused agent reads "Paused · For: …". The chat's own agent keeps "Your other chats". An agent with no purpose stays a one-line row.
@ also matches purposes, through the same shared ranking the desktop uses (rankNativeChatRoomMembers, purpose tier). When the match is in the purpose, the line starts near it (nativeChatMentionSnippet), e.g. @memory shows "For: …to memory use and dropped fra…".
Purposes come from the bots.roster read the phone already makes for the Members and hand-off sheets (useBotPurposes). It runs only once @ opens and runs again on each open, as the desktop's refreshBotPurposes does. Template purposes are shown and matched in the UI language (botTemplateText), like the phone's agents list.
The group room's @ rows are unchanged. The desktop shows no purpose there either.
Patterns followed: the row's existing subtitle (MobileNativeChatComposerBotRows.tsx:48, the "Your other chats" / "Paused" line), the hand-off sheet's purpose subtitle (workspace-hand-to-bot-sheet.tsx:137), and Members (MobileBotGroupMembers.tsx:196). The desktop source is use-bot-chat-composer-room.tsx:89 and NativeChatMentionOption.tsx.
Why
This closes a parity gap the audit found: the desktop @ list tells you what each agent does, and the phone's didn't. The subtitle takes the slot the row already has, so it adds no new style, spacing or component. Reading on open keeps chats from asking the computer for every agent's SOUL.md until someone types @.
Out of scope: listing agents on paired computers in the phone's @. That needs a new read on the computer side, so it comes later.
Linked Issue
None. A parity audit of the phone against the desktop found this.
Visual Proof
These are real page builds of an agent's Home chat in headless Chromium through the shell double, at 393×852. Before and after use the same data.
Typing @
Before
After
Dark
Light
Found by purpose, after (@memory, and @site for a paused agent. Before, neither listed any agent.)
@memory
@site (paused)
Dark
Light
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
I built the page bundle (pnpm build:mobile-web) on main and on this branch, then drove the agent chat in headless Chromium with a fake host that answers bots.list and bots.roster. I checked:
bare @
a purpose-only match
a paused agent matched by its purpose
an agent with no purpose
a long name with a long purpose
a host that doesn't answer bots.roster, where the rows match today's
In the rendered page, the "For:" line's computed styles (x 57, 12.5 px, text-muted in dark and light) match the existing "Your other chats" and "Paused" lines. pnpm check:changed and the mobile typecheck pass.
I added no test. This is a display line over shared ranking code that already has its own tests.
Performance
None, because the purposes are read once each time @ opens, not per keystroke. The page's eager bytes grow by 863 (8,281,328 → 8,282,191 of 8,388,608).
Risk
Level: Low
The riskiest part is an older computer that doesn't take bots.roster from the phone. The read fails quietly and the rows look like today's. Back out with a plain revert.
AI Disclosure
Review
Two reviewers each ran one round. Both raised the same two P2s, and both are fixed: template purposes are now translated before they show and before matching, and a paused agent keeps its purpose line. Left as is, P3: a roster reply that arrives after @ has closed is dropped and read again on the next open. The other phone screens that use useBotPurposes behave the same way.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Mobile only. It uses no new host method (bots.roster is already on the phone's list), and it works the same on a chat that runs on a paired server, because the read goes to the chat's own host.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
The mobile bot mention menu now loads translated purposes while open and adds available purposes to bot rows. Matching purpose text can appear as a snippet around the match. Bot rows display purpose notes, with separate handling for paused bots and unpaused owned bots. English and Chinese translations provide the purpose label.
Merge Risk: Low · up to a8640
Searching agents by purpose works for single-word queries on mobile. A multi-word query that matches only a purpose closes the mention menu instead of showing the agent. This is a small functional gap that can be fixed or documented, and the rest of the change looks safe to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(mobile): @ in an agent chat shows what each agent is for" matches the main change: the mobile @ mention list now shows each agent's purpose as a "For: …" subtitle. It also covers the p…
Description check
The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, N…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat(mobile): @ in an agent chat shows what each agent is for" matches the main change: the mobile @ mention list now shows each agent's purpose as a "For: …" subtitle. It also covers the purpose-based search, which is a secondary part of the change, and it is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections, and each is substantively filled in. Visual proof is provided with before and after images for dark and light modes. The Linked Issue section says 'None' with a parity-audit explanation, but the template states that an issue should always exist for outside contributors, so this is a gap. The Risk level is set to Low, and the AI Disclosure section is left empty, which the template marks as internal-only. The Testing section states that no automated test was added, with a reason given. The Performance section is filled in. The description is mostly complete and the check should pass, with the missing linked issue noted as a point to address.
Resolution
Consider linking an issue in the Linked Issue section, or confirm with maintainers that none is required for this change. The template states an issue should always exist for outside contributors.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Multi-word purpose queries close the mention… · use-mobile-native-chat-mention-bot-menu.ts:43
mobile/src/session/native-chat/composer/menus/use-mobile-native-chat-mention-bot-menu.ts:43 Minor · Functional Correctness · Quick win
Multi-word purpose queries close the mention menu before the purpose match applies.
The @ trigger accepts a query that contains a space only when nameMatches returns true. In this hook, that predicate checks member names only. For @memory use, a bot whose purpose is "Owns memory use audits" fails the predicate, so the menu closes and autocomplete does not insert the bot. Single-word queries such as @memory do not pass through this gate, so they still show purpose matches.
Make the spaced-query gate and the purpose ranking agree. Either accept purpose matches for spaced queries, so the menu stays open and inserts the bot, or limit purpose matching to single-token queries and document that limit.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 7c8dd06f-c3d2-43b8-b47b-4d27b493856e
Commits
Reviewing files that changed from the base of the PR and between 2982744 and a8640d3.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you type @ in an agent chat on the phone, each agent in the list now says what it's for, the same "For: …" line the desktop shows. You can also find an agent by typing a word from what it's for.
What Changed
components.native-chat.composer.botFor). A paused agent reads "Paused · For: …". The chat's own agent keeps "Your other chats". An agent with no purpose stays a one-line row.rankNativeChatRoomMembers, purpose tier). When the match is in the purpose, the line starts near it (nativeChatMentionSnippet), e.g.@memoryshows "For: …to memory use and dropped fra…".bots.rosterread the phone already makes for the Members and hand-off sheets (useBotPurposes). It runs only once @ opens and runs again on each open, as the desktop'srefreshBotPurposesdoes. Template purposes are shown and matched in the UI language (botTemplateText), like the phone's agents list.Patterns followed: the row's existing subtitle (
MobileNativeChatComposerBotRows.tsx:48, the "Your other chats" / "Paused" line), the hand-off sheet's purpose subtitle (workspace-hand-to-bot-sheet.tsx:137), and Members (MobileBotGroupMembers.tsx:196). The desktop source isuse-bot-chat-composer-room.tsx:89andNativeChatMentionOption.tsx.Why
This closes a parity gap the audit found: the desktop @ list tells you what each agent does, and the phone's didn't. The subtitle takes the slot the row already has, so it adds no new style, spacing or component. Reading on open keeps chats from asking the computer for every agent's SOUL.md until someone types @.
Out of scope: listing agents on paired computers in the phone's @. That needs a new read on the computer side, so it comes later.
Linked Issue
None. A parity audit of the phone against the desktop found this.
Visual Proof
These are real page builds of an agent's Home chat in headless Chromium through the shell double, at 393×852. Before and after use the same data.
Typing
@Found by purpose, after (
@memory, and@sitefor a paused agent. Before, neither listed any agent.)@memory@site(paused)Testing
I built the page bundle (
pnpm build:mobile-web) on main and on this branch, then drove the agent chat in headless Chromium with a fake host that answersbots.listandbots.roster. I checked:@bots.roster, where the rows match today'sIn the rendered page, the "For:" line's computed styles (x 57, 12.5 px, text-muted in dark and light) match the existing "Your other chats" and "Paused" lines.
pnpm check:changedand the mobile typecheck pass.I added no test. This is a display line over shared ranking code that already has its own tests.
Performance
None, because the purposes are read once each time @ opens, not per keystroke. The page's eager bytes grow by 863 (8,281,328 → 8,282,191 of 8,388,608).
Risk
Level: Low
The riskiest part is an older computer that doesn't take
bots.rosterfrom the phone. The read fails quietly and the rows look like today's. Back out with a plain revert.AI Disclosure
Review
Two reviewers each ran one round. Both raised the same two P2s, and both are fixed: template purposes are now translated before they show and before matching, and a paused agent keeps its purpose line. Left as is, P3: a roster reply that arrives after @ has closed is dropped and read again on the next open. The other phone screens that use
useBotPurposesbehave the same way.Agent skill upstream boundary
Notes
Mobile only. It uses no new host method (
bots.rosteris already on the phone's list), and it works the same on a chat that runs on a paired server, because the read goes to the chat's own host.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)