Repository navigation
fix(mobile): keep a finished agent tab's icon when its name mentions another agent - #40513
Merged
Merged
Conversation
The host publishes a terminal tab's name (custom name, quick-command label or agent session name) in place of its live title. Mobile fed that name to the shared tab-agent resolver as title evidence, so a finished Claude tab named "Agy status bar item" was read as a reused Antigravity pane. Desktop resolves from the raw title and shows Claude. Fixes #40084 Co-authored-by: Wenhao <[email protected]>
9 of 11 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
On the phone, a finished Claude tab could show the Antigravity icon just because its name started with "Agy". The phone was reading the tab's name as if Claude had typed it into the terminal title. Now a tab's name no longer counts as a clue to which agent is running.
What Changed
Before: a Claude terminal tab named "Agy status bar item" (Claude's own session name) showed the Antigravity icon on mobile once its turn finished. Desktop showed Claude.
After: the tab keeps the Claude icon on mobile. When the published title is the tab's name (a custom name, quick-command label, Claude/Codex session name, or generated name), mobile stops passing it to the shared tab-agent resolver as title evidence. Real terminal titles still count, as they do on desktop.
How it works:
title, plus the name fields it was resolved from (customTitle,quickCommandLabel,aiVaultTitle,generatedTitle).resolveTabNameSource, the same order the host used. If the published title is that name, it isn't the agent's own title, so it isn't passed in as evidence.Why
Supersedes #40085. Thanks @Manho for the report and the analysis that pinned it to
resolveMobileTerminalTabAgentId.Root cause: desktop resolves the icon from the raw terminal title,
✳ Agy status bar item. The✳prefix marks it as Claude's, so the "Agy" in the task text is ignored. Mobile never gets that raw title. It gets the session nameAgy status bar itemwith no prefix, and it fed that name to the same resolver. The resolver's "a title naming a different agent means the pane was reused" rule then outranked the finished Claude hook.#40085 instead made a finished hook that matches the launch agent outrank the title. That fixes this report, but it also stops mobile from spotting an agent started by hand in that pane by its real terminal title, which desktop still does. It also doesn't help a finished tab with no launch identity. This change removes the wrong input instead, so mobile and desktop read the same evidence.
Linked Issue
Fixes #40084
Visual Proof
The real
MobileSessionTabStriprendered through the mobile web bundle, fed the tab the host publishes: a finished Claude tab whose session name is "Agy status bar item", next to a working Claude tab.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
Added
mobile-terminal-tab-agent.test.ts: a finished Claude tab whose session name is "Agy status bar item" resolves toclaude. It fails without the fix (expected 'antigravity' to be 'claude').Ran the real headless host projection (
buildHeadlessMobileSessionTerminalTabs) on a tab with live title✳ Agy status bar itemand that session name. It publishestitle: "Agy status bar item"plusaiVaultTitle, and the phone now resolvesclaude. A raw reuse title (agy) on the same finished Claude tab still resolves toantigravity, and a tab with no launch identity still falls back to its title.Before/after screenshots of the real tab strip above.
pnpm check:changed, mobiletsc --noEmitand the mobileterminal/sessionandsession/tabstests pass.Risk
Mobile only, no protocol or saved-data change. Hosts already send the name fields. Older hosts that omit them keep today's behaviour.
Riskiest part: a named tab no longer uses its title to spot an agent started by hand. That title was the name, not the agent's title, so it was never real evidence. Such a tab shows the previous agent until the new agent's hook arrives.
Back out with a plain revert.
Level: Low
AI Disclosure
Review
Follow-ups, not in this PR:
titletoo, so its icon has the same misread.Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)