Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds nullable title updates to the tab-property path and persists them as custom titles on terminal tabs. Host projections include persisted custom titles, and hydration detects title differences between persisted tabs and snapshots before deciding to rebuild. Graph publication includes custom titles, and renderer mirroring adopts surface titles while retaining a local title when no surface title is available. Tests cover title persistence, projection precedence, mirroring, and snapshot mismatch cases. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🟡 Moderate · up to Renames now persist across reloads. Clearing a rename can still leave the old name visible in the live session and on other mirrored clients. Fix the clear path before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/renderer/src/runtime/web-session-tabs-sync/terminal-build-custom-title.test.ts (1)
74-75: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the visible title in the fresh-browser test.
The fixture sets
customTitlebut keepstitle: 'Terminal'. The mirror derivestab.titlefrom the hosttitlefield, so this test does not model the host projection, which publishes both fields.Set both fields and assert
tab.title:Suggested test update
- const tab = mirror(makeSnapshot({ customTitle: 'my rename' })) + const tab = mirror(makeSnapshot({ title: 'my rename', customTitle: 'my rename' })) expect(tab.customTitle).toBe('my rename') + expect(tab.title).toBe('my rename')
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 20c534a6-fe6d-4eb8-a4f3-758cc5626897
📒 Files selected for processing (9)
src/main/runtime/mobile-session-terminal-custom-title.test.tssrc/main/runtime/mobile-session-terminal-projection.tssrc/main/runtime/orca-runtime-hydrate-headless-mobile-session-tabs-from-workspace-session.tssrc/main/runtime/runtime-mobile-session-projection-custom-title.test.tssrc/main/runtime/runtime-mobile-session-projection.tssrc/renderer/src/runtime/web-session-tabs-sync/terminal-build-custom-title.test.tssrc/renderer/src/runtime/web-session-tabs-sync/terminal-build.tssrc/shared/runtime-mobile-session-tab-contracts.tssrc/shared/runtime-session-contracts.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
The rename persistence fix is one-directional: it makes a set rename survive reload, but clearing a rename (customTitle: null) is neither reconciled nor detected, so a cleared rename sticks. See the inline comment.
Reviewed changes
This PR threads a persisted manual terminal rename (customTitle) through the headless serve projection chain so it survives a browser reload:
- Wire contracts — adds optional
customTitle?: string | nulltoRuntimeMobileSessionTerminalTabandRuntimeSyncedTab(wire-safe optional fields). - Headless projection —
buildHeadlessMobileSessionTerminalTabsnow publishes the persistedcustomTitleon each built surface. - Mobile session projection —
projectRuntimeMobileSessionTabsputspersistedCustomTitleahead of OSC/agent/tracker titles and republishes it. - Hydrate skip path — a new
persistedCustomTitleMissingFromSnapshotgate forces a rebuild when a persisted rename is absent from the existing snapshot. - Web mirror —
buildMirroredTerminalTabsadopts the host-publishedcustomTitleover any stale local value. - Tests — new unit coverage for the build, projection priority, hydrate gap, and mirror adoption.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — the two prior findings are resolved, with one minor residual noted inline.
Reviewed changes
- Made the hydrate gap detector symmetric, so a cleared rename (persisted
null) still carried by the snapshot now forces a rebuild instead of sticking across reload. - Bypassed agent-title normalization for persisted manual renames, so a user's exact string survives verbatim (e.g. a name matching the legacy
π > …shape). - Published
customTitleinto the renderer graph (RuntimeSyncedTab, both registered and parked tabs), wiring up the previously deadsyncedTab?.customTitlefallback.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| // Why: a persisted manual rename outranks every OSC/agent observation; without | ||
| // this the fresh leaf title masks the rename after a browser reload (#serve). | ||
| // Raw, never normalized — the user typed exactly this. | ||
| const persistedCustomTitle = tab.customTitle ?? syncedTab?.customTitle ?? null |
There was a problem hiding this comment.
The clear direction now survives reload, but the revert is reload-bound: renameTerminal(handle, null) nulls the live pty.title and persists customTitle: null, yet touchMobileSessionSnapshotsForPty only re-emits the stored snapshot, which still carries the old customTitle. This priority line then re-imposes the stale rename until the next full hydrate, so a cleared title still shows the old name until the browser reloads (pre-PR, clearing reverted immediately via the live OSC/agent title).
Technical details
# Clear-rename revert is deferred to the next full hydrate
## Affected sites
- src/main/runtime/runtime-mobile-session-projection.ts:143 — `tab.customTitle` from the stored snapshot outranks the live title evidence, so a clear that only nulls `pty.title` is masked until the snapshot is rebuilt.
- src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts:125-129 — the clear path calls `touchMobileSessionSnapshotsForPty`, which bumps + re-emits the stored snapshot without clearing its `customTitle`.
- src/main/runtime/mobile-session-tab-merge.ts:27-33 — the every-graph-sync runtime-owned hydrate merges `existing.tabs` first, so the stale `customTitle` is retained rather than dropped.
## Required outcome
- After a clear, the published title should revert to the live OSC/agent title without waiting for a reload, symmetric with the set direction (which shows immediately via `pty.title`).
## Suggested approach (optional)
- In the clear path (`renameTerminal` with `title === null`), also clear the stored snapshot's `customTitle` for that parent tab (option 2 from the prior review), or drop the stale `customTitle` field during the re-emit.The change detector skipped customTitle: null, so clearing a rename left the stale title on the stored snapshot forever. Treat any divergence between persisted and snapshot customTitle as needing rebuild.
normalizeCompatibleAgentTitleForOwner rewrote legacy agent-shaped custom titles; a manual rename must publish exactly what the user typed. Normalize only the observed-title fallback chain.
RuntimeSyncedTab.customTitle was declared but never written, leaving the main-side projection fallback dead. Wire the persisted rename into both graph.tabs.push sites.
120e546 to
49b3f12
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4be42dbf-a762-493e-b467-616a7290bc35
📥 Commits
Reviewing files that changed from the base of the PR and between 120e546b8c6f6124dec4dd9dd5cbb6bff7b1e170 and 49b3f12.
📒 Files selected for processing (6)
src/main/runtime/orca-runtime-hydrate-headless-mobile-session-tabs-from-workspace-session.tssrc/main/runtime/runtime-mobile-session-projection.tssrc/renderer/src/runtime/sync-runtime-graph/graph-publication.tssrc/renderer/src/runtime/web-session-tabs-sync/terminal-build.tssrc/shared/runtime-mobile-session-tab-contracts.tssrc/shared/runtime-session-contracts.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.
| customTitle: | ||
| (activeSurface.customTitle ?? surfaces.find((s) => s.customTitle)?.customTitle) || | ||
| existing?.customTitle || | ||
| null, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '150,220p' src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts
sed -n '155,205p' src/main/runtime/runtime-mobile-session-projection.ts
sed -n '65,100p' src/renderer/src/runtime/sync-runtime-graph/graph-publication.ts
sed -n '140,175p' src/renderer/src/runtime/sync-runtime-graph/graph-publication.tsRepository: stablyai/orca
Length of output: 8703
🏁 Script executed:
printf '%s\n' '--- projection customTitle and output construction ---'
rg -n -C 8 'persistedCustomTitle|customTitle|runtime-mobile-session-projection' src/main/runtime/runtime-mobile-session-projection.ts
printf '%s\n' '--- graph publication types and surface construction ---'
rg -n -C 6 'customTitle|graph\.tabs|Terminal.*Surface|terminal.*surface' src/renderer/src/runtime/sync-runtime-graph/graph-publication.ts
printf '%s\n' '--- grouping, builder callsites, and surface contracts ---'
rg -n -F -- 'buildMirroredTerminalTabs' src/renderer/src/runtime
rg -n -F -- 'customTitle' src/renderer/src/runtime/web-session-tabs-sync
printf '%s\n' '--- customTitle types/contracts in main and renderer ---'
rg -n -C 3 'customTitle\??:' src/main src/renderer/src | head -n 240Repository: stablyai/orca
Length of output: 28785
🏁 Script executed:
printf '%s\n' '--- mirror builder and surface grouping ---'
sed -n '1,215p' src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts
printf '%s\n' '--- builder input and group construction in caller ---'
sed -n '115,180p' src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-base.ts
rg -n -C 5 'surfacesBy|group.*surface|activeSurface|surfaces:' src/renderer/src/runtime/web-session-tabs-sync
printf '%s\n' '--- projection output declaration and exact projected object ---'
sed -n '1,45p' src/main/runtime/runtime-mobile-session-projection.ts
sed -n '275,325p' src/main/runtime/runtime-mobile-session-projection.ts
printf '%s\n' '--- surface and graph contract declarations ---'
rg -n -C 5 'interface .*Surface|type .*Surface|customTitle\??:|RuntimeMobileSession.*Tab|RuntimeMobileSession.*Surface|RuntimeMobileSessionProjectionHost' src/shared src/main/runtime/runtime-mobile-session-projection-contract.ts src/renderer/src/runtime/web-session-tabs-syncRepository: stablyai/orca
Length of output: 41918
🏁 Script executed:
printf '%s\n' '--- syncedTab bindings and callers ---'
rg -n -C 5 '\bsyncedTab\b|projectRuntimeMobileSessionTabs\(' src/main
printf '%s\n' '--- projection contract ---'
sed -n '1,240p' src/main/runtime/runtime-mobile-session-projection-contract.ts
printf '%s\n' '--- relevant runtime mobile terminal/client type declarations ---'
rg -n -C 9 'RuntimeMobileSession(Terminal|Client|Snapshot)Tab|customTitle\??:' src/shared/runtime-types.ts src/shared
printf '%s\n' '--- builder custom-title test assertions and fixtures ---'
sed -n '1,130p' src/renderer/src/runtime/web-session-tabs-sync/terminal-build-custom-title.test.ts
printf '%s\n' '--- projection tests covering customTitle clear or omission ---'
rg -n -C 6 'customTitle|persisted rename|rename' src/main/runtime/*projection*test* src/main/runtime/*session*test*Repository: stablyai/orca
Length of output: 41843
🏁 Script executed:
printf '%s\n' '--- contracts ---'
rg -n -C 6 'export (type|interface) RuntimeSyncedTab|RuntimeSyncedTab =|customTitle.*wire compat|RuntimeMobileSessionTerminalTab =' src/shared
printf '%s\n' '--- graph publication ---'
nl -ba src/renderer/src/runtime/sync-runtime-graph/graph-publication.ts | sed -n '78,91p'
printf '%s\n' '--- projection input and customTitle output ---'
nl -ba src/main/runtime/runtime-mobile-session-projection.ts | sed -n '110,118p;180,192p;295,311p'
printf '%s\n' '--- renderer grouping and customTitle selection ---'
nl -ba src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts | sed -n '61,86p;126,136p;176,189p'
printf '%s\n' '--- builder compatibility tests ---'
nl -ba src/renderer/src/runtime/web-session-tabs-sync/terminal-build-custom-title.test.ts | sed -n '72,96p'
printf '%s\n' '--- projection customTitle absence contract test ---'
nl -ba src/main/runtime/runtime-mobile-session-projection-custom-title.test.ts | sed -n '114,130p'Repository: stablyai/orca
Length of output: 10071
Propagate explicit null when the host clears a terminal rename.
When the session snapshot has no non-null title and the synchronized graph reports customTitle: null, the main projection omits the field. buildMirroredTerminalTabs then restores existing.customTitle, so the cleared rename remains in the mirror. Preserve the fallback for older hosts that omit the field, but honor an explicit null from the current host.
🐛 Suggested fix
--- a/src/main/runtime/runtime-mobile-session-projection.ts
+++ b/src/main/runtime/runtime-mobile-session-projection.ts
@@
- ...(persistedCustomTitle ? { customTitle: persistedCustomTitle } : {}),
+ customTitle: persistedCustomTitle,
--- a/src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts
+++ b/src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts
@@
customTitle:
(activeSurface.customTitle ?? surfaces.find((s) => s.customTitle)?.customTitle) ||
- existing?.customTitle ||
+ (surfaces.some((surface) => Object.hasOwn(surface, 'customTitle'))
+ ? null
+ : existing?.customTitle) ||
null,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| customTitle: | |
| (activeSurface.customTitle ?? surfaces.find((s) => s.customTitle)?.customTitle) || | |
| existing?.customTitle || | |
| null, | |
| customTitle: | |
| (activeSurface.customTitle ?? surfaces.find((s) => s.customTitle)?.customTitle) || | |
| (surfaces.some((surface) => Object.hasOwn(surface, 'customTitle')) | |
| ? null | |
| : existing?.customTitle) || | |
| null, |
…TabProps color/pin/viewMode already had a write path for remote-server tabs, but a rename stayed local and reverted on the next host snapshot or reload. Carry an optional nullable 'title' on setTabProps, persist it to the workspace session + live snapshot like the other props, and mirror renderer renames outbound from setTabCustomLabel.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8ebc89d8-9649-40cb-a2d8-5549b3c75d82
📒 Files selected for processing (11)
src/main/runtime/mobile-session-terminal-custom-title.test.tssrc/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.tssrc/main/runtime/orca-runtime-persist-headless-session-tab-props.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-06.spec.tssrc/main/runtime/rpc/methods/session-tab-mutation-methods.tssrc/main/runtime/runtime-mobile-session-projection-custom-title.test.tssrc/renderer/src/runtime/web-runtime-terminal-actions.tssrc/renderer/src/runtime/web-session-tabs-sync/terminal-build-custom-title.test.tssrc/renderer/src/store/slices/tabs/tabs-host-mirroring.tssrc/renderer/src/store/slices/tabs/tabs-label-actions.tssrc/shared/rpc-contract/session-tabs-schemas-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| ...tab, | ||
| ...sharedProps, | ||
| ...(props.title !== undefined ? { customTitle: props.title } : {}), | ||
| ...(props.title ? { title: props.title } : {}) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Restore the automatic snapshot title when clearing a rename.
When title is null, this branch clears customTitle but leaves tab.title at the previous manual rename. The hydration mismatch check then sees matching null customTitle values and cannot detect the stale title. A browser reload can still show the old rename. Recompute the automatic title on clear, or rebuild the snapshot. Extend the clear test to assert the visible title.

Fixes #19582
ELI5
If you rename a terminal tab in the web/mobile client, the rename vanishes when the tab list is rebuilt (app restart, session reload, worktree switch). Desktop masked this with an in-memory round-trip that is equally lost on restart. This PR makes the manual rename a first-class field that is persisted, projected, and mirrored everywhere.
What
A manual terminal rename on
orca-serveis persisted into the workspace session but never surfaced again: the projection chain ignorescustomTitle, the hydrate skip path serves a stale first-wins snapshot, the renderer mirror drops the field, andRuntimeMobileSessionTerminalTabhas nocustomTitleon the wire. Desktop masks it day-to-day via an in-memory IPC round-trip that is equally lost on app restart.Root cause
Four gaps compound: (1) the shared wire contract has no
customTitlefield, (2) tab projection priority drops the persisted rename, (3) the headless hydrate skip path serves the existing snapshot without checking whether a persisted rename is missing from it, and (4) the renderer mirror ignoresincoming.customTitlewhen adopting host state.How (atomic commits)
feat(shared): optionalcustomTitle?: string | nullonRuntimeMobileSessionTerminalTab(wire compatible: new optional field, per remote-wire-compatibility guidance).fix(main): projection prioritycustomTitle ?? trackerOnlyTitle ?? leafTitle ?? ptyTitle ?? syncedTab?.title ?? tab.title; publishcustomTitleon built/projected tabs; mirror onRuntimeSyncedTab.fix(main): hydrate skip path falls through to rebuild when a persistedcustomTitleis missing from the existing snapshot (narrow gate, no globalforceflip).fix(main): never normalize away a persisted manual rename during tab rebuild.fix(renderer): web session tab mirror adoptsincoming.customTitleover stale local value.test: unit coverage for build, projection priority, hydrate gap, mirror adoption, and rename-clearing.The OSC tracker path is already fenced (
getUnpersistedTrackedTitleForPtyreturns null while a manualpty.titleis set), so no change was needed there.One commit (
cb8d1c8a) regeneratesen-runtime-required.jsononly to drop orphanminimumContrastentries upstream removed in 2abd8b0 — mechanical catalog sync required bysync:localization-runtime-catalog, not a behavioral change.Visual proof
N/A — no UI surface changes; terminal tab titles simply retain their persisted value across rebuilds.
Testing
pnpm vitest run src/main/runtime/mobile-session-terminal-custom-title.test.ts src/main/runtime/runtime-mobile-session-projection-custom-title.test.ts src/renderer/src/runtime/web-session-tabs-sync/terminal-build-custom-title.test.ts— new coverage, all passruntime-environments-pairing.test.tsupdated for the catalog-independent handler orderingPlatform coverage
Compatibility
Linked work
AI disclosure
Authored with AI assistance (Claude); human-reviewed.
Review notes
minimumContrastcatalog removal is the only i18n diff; flagged here since the pre-merge check flags it as out of scopeChecklist