Repository navigation
fix(mobile): keep a renamed tab's name on mobile after the host restarts - #33743
Conversation
After a restart, the reconnecting client restarts each saved tab's terminal (restored-pane-materialize -> createRuntimeOwnedMobileSessionTerminal), and the mobile row built from the new terminal carried no customTitle, so the phone showed the terminal's own title although the saved session still held the name. publishPtyBackedMobileSessionTerminal kept a name only from an earlier mobile row, which a restart does not have. Both builders now resolve the name through one helper: a value already on the mobile row wins, including a cleared null; only a row with no value falls back to the tab's saved name. Fixes stablyai#33737 Co-Authored-By: Claude Code <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
No actionable comments were generated in the recent review.
|
…ManualTitle getPtyManualTitle already owns a terminal's manual name (the saved tab's, else the live rename), so the row builders use it instead of a second saved-session lookup. A cleared name reads as cleared from the saved session, so the test now covers that instead of a row-only clear.
… saved one A null customTitle on a row is a clear: paired desktops need it to drop a cached name, and a desktop clear lands on the row before the debounced session write. Only a row with no value falls back to getPtyManualTitle.
|
Thanks @clayphi, the fix is in the right place. I pushed commits on top: both row builders now read the saved name through the existing |
|
Merged main into the branch so CI runs against main's line-limit repair (#34256); no code change to this fix. |
ELI5
If you rename a terminal tab and then the host restarts, the phone forgot the name and showed the terminal's own title. Desktop and web kept the name. Now the phone keeps it too.
What Changed
Before: rename a tab (for example to
brain) in Orca Web, and the paired phone showsbrain. Restart the host and reconnect the web client, and the phone shows the terminal's own title (for Claude Code, its conversation title). The saved workspace session still holdscustomTitle: "brain"for the tab.After: the phone shows
brainafter the restart. A name that was cleared stays cleared, and a tab that was never renamed is unchanged.Mechanism: after a restart, the reconnecting client asks the host to restart each saved tab's terminal (
restored-pane-materialize.ts→createRuntimeOwnedMobileSessionTerminal). That builder created the mobile row from the new terminal with nocustomTitleat all, and later rebuilds from the saved session keep that existing row (mergeMobileSessionSnapshotTabs), so the name never came back.publishPtyBackedMobileSessionTerminalhad a narrower form of the same gap: it kept a name only from an earlier mobile row, which a restart does not have.Both builders now resolve the name through one small helper,
session-tabs/saved-tab-custom-title.ts:null(the name was cleared on mobile);customTitlein the workspace session.Why
The saved session is already the source of truth that Orca Web uses for the name after a restart, so reading it at the two places that build a mobile row from a (re)started terminal fixes the root cause where those rows are created. The alternatives were patching the merge step to prefer saved names (that would override a name deliberately cleared on mobile) or re-publishing renames after hydration (more moving parts, and it would still briefly show the wrong title).
Linked Issue
Fixes #33737
Visual Proof
No screenshots or video attached. The change is in the host's mobile tab rows, and the before/after is captured by the new regression tests below (4 of 5 fail on
mainwithout this change, all 5 pass with it). I also verified it end to end on a Linux headless host built from v1.4.237 with this change: the mobile tab list (session.tabs.list) showed the renamed tab's name before a full host restart and, with this change, after it; without it, the name was gone after the restart.Testing
Linux only (headless
orca servehost plus the web client and the Orca Mobile app). Not tested on macOS, Windows or SSH hosts; the change touches only main-process mobile row construction and no platform-specific code.New test
src/main/runtime/orca-runtime-terminal-saved-name-respawn.test.ts(5 tests):Run on this branch (based on
mainat 1ff73e8), on Node:pnpm lint: passpnpm typecheck: passpnpm build: passVitest,
src/main/runtime(1,403 files): the new tests pass. 18 tests in 7 unrelated files fail (agent-session store transactions, agent launch replay, and the zsh login-shell live test); the same 18 fail identically on unmodifiedmainin the same environment, so they come from my environment, not this change.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code (Anthropic's Claude). I reviewed the change, and it was verified with the tests and the live check described above.
Review
Agent skill upstream boundary
Notes
Security: no new inputs; the name comes from the host's own saved session. Cross-platform: no platform-specific code. Remote SSH: unchanged code path apart from the same row construction. Mobile: this is the fix. Backwards compatibility: a row's existing value still wins, so nothing that already worked changes. Performance: one lookup in the in-memory saved session per row build.
Checklist
N/Awith reason (no media; before/after is shown by the regression tests and the live check described above)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) (lint, typecheck and build pass locally; tests as described above)