Repository navigation
fix(mobile): show a renamed terminal tab's name on the phone - #30163
Conversation
The host published the terminal's live title, which agents repaint every few seconds, so a rename from the phone never showed up there. Fixes #28665
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When you renamed a terminal tab from the phone, the desktop showed the new name but the phone kept the old one. The phone now shows the name you picked.
What Changed
accepted: trueand renamed the tab on the desktop, but the phone's tab strip kept showing the terminal's own title, for example✳ Claude Code. This happened on every terminal that sets its own window title, including a plain shell tab, not only agent tabs.titlethatsession.tabs.listpublishes. The host built thattitlefrom the terminal's live title first (tracker, pane and PTY titles), and agents set a new one every few seconds. The user's name was already in the same snapshot ascustomTitle, buttitlenever looked at it. The host now publishescustomTitleastitlewhen one is set and falls back to the live title otherwise (runtime-mobile-session-projection.ts).Why
The phone already listens for tab updates and renders
title, so fixing the title on the host fixes every phone version, old builds included, with no phone release and no change to what the host and phone send each other. The other option was having the phone readcustomTitleitself. That needs a new phone build, older phones would stay broken, and the CLI and other readers ofsession.tabs.listwould still get the stale title.The custom name skips
normalizeCompatibleAgentTitleForOwner, because that function rewrites agent-branded titles and could change a name the user typed.Linked Issue
Fixes #28665
Visual Proof
N/A: no layout change. The tab text is now the name the user chose. The live run under Testing shows the title before and after.
Testing
Live, on macOS: hidden dev desktop on a scratch profile, with Claude running in a terminal tab. I sent the same
terminal.renamecall the phone sends, then readsession.tabs.list."title": "✳ Claude Code"with"customTitle": "My Renamed Tab". A shell tab behaved the same way."title": "Fix Check". I had Claude run a slow task. Its live title changed every frame (◐ Slow counting with Bash sleep), the published title stayed "Fix Check", and the status went fromworkingtodone. Clearing the name published the live title again.New test in
mobile-session-tabs-part-05.spec.ts: a renamed tab is published under its name over a newer agent title, and under the live title once cleared. It fails on main with"⠂ Claude Code".src/main/runtime/orca-runtime.test.ts: 1,431 tests pass. The one failure,preserves existing badgeColor on runtime cloneRepo folder->git dedupe upgrade, also fails on unmodified main on macOS.pnpm lint,pnpm tc,check:code-quality:changed,check:react-doctor:changed,check:zustand-selector-fanout.I did not open the phone app itself, and I did not run a server with no desktop window live. A server with no desktop window publishes
customTitlethe same way since fix(remote): make the host's tab name the one source for CLI and desktop renames #30037, so the same line covers it.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
Notes
SSH and folder workspaces: the rule runs wherever the terminal's host builds the phone's tab list, and it does not depend on the workspace type. Mixed versions: an older host leaves
customTitleout, so the title falls back to the live title as it does today, and older phones get the fix with no update.Not changed:
terminal.liststill reports the live title, so the phone's rename box opens with the terminal's title filled in instead of the current custom name.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)