Skip to content

fix(mobile): keep a renamed tab's name on mobile after the host restarts - #33743

Merged
AmoabaKelvin merged 5 commits into
stablyai:mainfrom
clayphi:fix/mobile-saved-tab-name
Oct 27, 2026
Merged

AmoabaKelvin merged 5 commits into
stablyai:mainfrom
clayphi:fix/mobile-saved-tab-name

Conversation

@clayphi

@clayphi clayphi commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20

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 shows brain. 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 holds customTitle: "brain" for the tab.

After: the phone shows brain after 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 no customTitle at all, and later rebuilds from the saved session keep that existing row (mergeMobileSessionSnapshotTabs), so the name never came back. publishPtyBackedMobileSessionTerminal had 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:

  • a value already on the mobile row wins, including null (the name was cleared on mobile);
  • only a row with no value falls back to the tab's saved customTitle in 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 main without 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 serve host 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):

  • the saved name reaches the phone when a terminal is created for a saved tab, with and without a notifier (headless);
  • the saved name reaches the phone when a client restarts the saved tab's terminal by its identity (the reconnect path);
  • a name cleared on the mobile row stays cleared when the terminal restarts;
  • a tab with no saved name keeps its terminal title.

Run on this branch (based on main at 1ff73e8), on Node:

  • pnpm lint: pass

  • pnpm typecheck: pass

  • pnpm build: pass

  • Vitest, 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 unmodified main in 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • 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)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason (no media; before/after is shown by the regression tests and the live check described above)
  • 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) (lint, typecheck and build pass locally; tests as described above)

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]>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 6fdefae1-10a1-473a-8685-68db31c316e5
Commits

Reviewing files that changed from the base of the PR and between c415b54 and 8c72cd0.

Files selected for processing: 3
  • src/main/runtime/orca-runtime-terminal-saved-name-respawn.test.ts
  • src/main/runtime/session-tabs/pty-backed-session-publication.ts
  • src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts

No actionable comments were generated in the recent review.

Recent 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: fcd6fbd7-0ba5-48f8-81fd-e20a72c3aaf3
Commits

Reviewing files that changed from the base of the PR and between c27716d and c415b54.

Files selected for processing: 3
  • src/main/runtime/orca-runtime-terminal-saved-name-respawn.test.ts
  • src/main/runtime/session-tabs/pty-backed-session-publication.ts
  • src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

Mobile terminal creation and publication now use a saved PTY manual title when no existing row title is defined. An existing customTitle, including null, takes precedence. Added tests cover saved titles after creation and restart, as well as absent and cleared titles.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · previous review c415b

Renamed tab names are restored on mobile after a host restart, and a name cleared while a phone is connected stays cleared. A phone that missed the clear while disconnected may still show its earlier name after a restart. This is a narrow edge case and does not need to block the merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the mobile tab-name fix after a host restart and matches the primary change.
Description check Passed The description is complete and covers the user impact, implementation, rationale, linked issue, testing, limitations, AI disclosure, and checklist. The visual-proof requirement is addressed with a wr…
Linked Issues check Passed Issue #33737 requires a saved Orca Web tab name to remain on the mobile row after the host restarts. It also requires a cleared name to remain cleared. createRuntimeOwnedMobileSessionTerminal preser…
Out of Scope Changes check Passed The changed production code updates only the two mobile terminal row builders that handle creation and restart. The added tests cover the issue behavior. The new getPtyManualTitle contracts support …
Full details: Description check

Explanation

The description is complete and covers the user impact, implementation, rationale, linked issue, testing, limitations, AI disclosure, and checklist. The visual-proof requirement is addressed with a written explanation and regression-test evidence, although the checklist remains unchecked and does not use the exact N/A format.

Full details: Linked Issues check

Explanation

Issue #33737 requires a saved Orca Web tab name to remain on the mobile row after the host restarts. It also requires a cleared name to remain cleared. createRuntimeOwnedMobileSessionTerminal preserves an existing customTitle, including null, and otherwise uses getPtyManualTitle for the saved name. publishPtyBackedMobileSessionTerminal applies the same precedence. The regression tests cover saved names, cleared names, unnamed tabs, and restart by tab identity.

Full details: Out of Scope Changes check

Explanation

The changed production code updates only the two mobile terminal row builders that handle creation and restart. The added tests cover the issue behavior. The new getPtyManualTitle contracts support the saved-name lookup required by these builders. No unrelated feature or platform-specific change is shown.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown
Collaborator

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 getPtyManualTitle instead of a second lookup, so saved-tab-custom-title.ts is gone. A row's cleared null still wins, and your tests stay, plus a cleared-name case.

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

Merged main into the branch so CI runs against main's line-limit repair (#34256); no code change to this fix.

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.

[Bug]: Renamed terminal tab loses its name on Orca Mobile after the host restarts

2 participants