Repository navigation
fix(remote): persist Web terminal custom titles - #17644
JasonJarvan wants to merge 3 commits into
Conversation
Greptile SummaryThe PR persists custom Web terminal titles on headless remote hosts and reconciles them across clients, refreshes, and host restarts while retaining compatibility with older hosts.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/runtime/rpc/methods/session-tabs-schemas.ts | Adds optional nullable custom-title validation with the shared 256-character persistence boundary. |
| src/main/runtime/orca-runtime.ts | Persists remote terminal titles into host session state and republishes resolved titles in headless snapshots. |
| src/renderer/src/runtime/web-session-custom-title-intent.ts | Tracks optimistic rename intent so stale snapshots do not overwrite an in-flight local title. |
| src/renderer/src/runtime/web-session-tabs-sync.ts | Reconciles authoritative title values while preserving local titles when older hosts omit the new field. |
| src/renderer/src/components/tab-bar/SortableTab.tsx | Applies the same shared title-length limit to the interactive rename field. |
| tests/e2e/session-tabs-custom-title-persistence.unit.test.ts | Covers multi-client propagation, compatibility, persistence, restart, and title clearing. |
Sequence Diagram
sequenceDiagram
participant W1 as Web client 1
participant H as Remote host
participant S as Workspace session
participant W2 as Web client 2
W1->>H: session.tabs.setTabProps(customTitle)
H->>H: Validate title length
H->>S: Persist customTitle
H-->>W1: Publish updated snapshot
H-->>W2: Publish updated snapshot
W1->>W1: Reconcile optimistic intent
W2->>W2: Adopt authoritative title
Reviews (2): Last reviewed commit: "fix(remote): harden terminal title synch..." | Re-trigger Greptile
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe change adds nullable custom titles to the session-tab RPC contract and headless runtime persistence. Renderer title changes are mirrored to the runtime, and incoming snapshots reconcile with temporary local title intents. The change also sets a shared 256-character limit and adds tests for title updates, clearing, persistence, and synchronization. Priority: ➖ Normal Estimated code review effort: Severity of issue fixed: Medium Merge Risk: 🟡 Moderate · up to Remote Web renames may be acknowledged without reaching the owning window, allowing a later snapshot to restore the old title. Confirm or correct that path before merging. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The existing tab-visibility check and title-length limit constrain the new field. However, the host can share a changed title even when the backing session was not updated, so clients may see a name that disappears after restart. Remote authorization and storage-failure behavior remain incompletely established. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4f6fb77a-d8c7-4c83-a01c-7a951cc00808
📥 Commits
Reviewing files that changed from the base of the PR and between ca516a4 and 41419d41afb6f12a07e70317bebe5d7775deee66.
📒 Files selected for processing (12)
src/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/session-tab-agent-capability-mutations.test.tssrc/main/runtime/rpc/methods/session-tab-mutation-methods.tssrc/main/runtime/rpc/methods/session-tabs-schemas.test.tssrc/main/runtime/rpc/methods/session-tabs-schemas.tssrc/renderer/src/runtime/web-runtime-session-tab-props.test.tssrc/renderer/src/runtime/web-runtime-terminal-actions.tssrc/renderer/src/runtime/web-session-tabs-sync.tssrc/renderer/src/store/terminals/terminal-tab-attention.tssrc/renderer/src/store/terminals/terminal-tab-title-runtime-mirror.test.tssrc/shared/runtime-mobile-session-tab-contracts.tstests/e2e/session-tabs-custom-title-persistence.unit.test.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.
ℹ️ No critical issues — one rough edge worth a look, plus a small wire-schema nit.
Reviewed changes
customTitleon the session-tabs wire contract —RuntimeMobileSessionTerminalTabgains an optionalcustomTitle?: string | null, andSetTabPropsaccepts a nullablecustomTitlealongsidecolor/isPinned/viewMode.- Host-side persistence & snapshot fan-out —
setMobileSessionTabPropspersistscustomTitleinto the workspace session (terminal tabcustomTitle, unified tabcustomLabel) and republishes incremental snapshots, resolving the displaytitlethrough the same fallback chain the full rebuild uses. - Client-side mirror & adoption —
setTabCustomTitlemirrors renames/clears through the extractedmirrorTerminalTabPropsToRuntime;buildMirroredTerminalTabsadopts the host'scustomTitlewhile keeping local titles when an older host omits the field. - Test coverage — schema tri-state (set/clear/absent), RPC forwarding, renderer mirror calls, and an end-to-end unit test covering two clients, refresh, host restart, clear, and old-host compatibility.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Length-bounded
customTitle— addedCUSTOM_TAB_TITLE_MAX_LENGTH = 256, shared by theSetTabPropsschema (z.string().max(...)) and the tab rename input (maxLength), so untrusted host input is capped before it reaches persisted session state. - Optimistic rename intent tracking — new
web-session-custom-title-intentmodule records each client rename's previous/intended titles and reconciles them against host snapshots: a stale echo keeps the optimistic title, host acknowledgement and third-party values stay authoritative, with a 30s TTL fallback. - RPC plumbing for
previousCustomTitle—setTabCustomTitlecaptures the pre-rename title and threads it throughsetWebRuntimeTabPropsvia the extractedWebRuntimeTabPropsMutationtype; intents are retargeted to the resolved host tab id and cancelled on failure. - Sorted host-side fallback title —
resolvePersistedHeadlessTerminalTitlenow sorts tabs before derivingTerminal N, matching the full-rebuild fallback chain. - Test coverage — schema bound, intent reconciliation (stale echo, rapid rename, third-party, expiry), mirror rename/clear calls, and e2e stale-snapshot and sorted-fallback cases.
ℹ️ Minor note
On an older host that omits customTitle from snapshots, each rename records an intent that is never reconciled (reconciliation is gated on the host publishing customTitle), so entries accumulate in the module-level map until worktree teardown. Bounded and negligible in practice — no action required.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
dbf5222 to
bf895eb
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Relocated host-side
customTitlepersistence into the mixin chain —persistHeadlessSessionTabProps/applyHeadlessSessionTabPropsToSnapshot/resolvePersistedHeadlessTerminalTitlemoved out of the monolithicorca-runtime.tsintoorca-runtime-persist-headless-session-tab-props.ts(nowprotected), withsetMobileSessionTabPropsinorca-runtime-close-headless-mobile-terminal-tab.tsacceptingcustomTitle. - Projected
customTitlein the canonical build —buildHeadlessMobileSessionTerminalTabsnow emitscustomTitleon the snapshot terminal tab. - Split the renderer sync changes — the
buildMirroredTerminalTabshostcustomTitlereconciliation now lives inweb-session-tabs-sync/terminal-build.ts, and intent teardown moved totracking-lifecycle.ts.
This is a behavior-preserving refactor of the previously approved changes: the same length-bound schema, intent-based echo guard, and sorted fallback title are relocated into the codebase's established mechanically-split mixin files. No new behavior introduced.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
@nwparker This is rebased and ready for maintainer review at bf895ebd91. The current head passes 6 focused files / 43 tests, pnpm tc, and changed-code quality; there are no unresolved review threads. The PR body now distinguishes current-head validation from the earlier pre-rebase E2E/rendered smoke. |
The changed-line casting gate rejects the partial store doubles used by title persistence unless each assertion carries a SAFETY rationale.
bf895eb to
b4ddda6
Compare
|
Rebased onto latest origin/main and resolved merge conflicts. Verified typecheck, session tabs schemas/custom title unit tests, and code quality checks pass cleanly. |
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: deecea92-32ba-4f96-9a50-2a021aecd61a
📥 Commits
Reviewing files that changed from the base of the PR and between bf895ebd916ccc0d6f891bf3878434bcf6f558e6 and b4ddda6.
📒 Files selected for processing (12)
src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.tssrc/main/runtime/orca-runtime-persist-headless-session-tab-props.tssrc/main/runtime/rpc/methods/session-tab-agent-capability-mutations.test.tssrc/main/runtime/rpc/methods/session-tab-mutation-methods.tssrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/runtime/web-session-tabs-sync/terminal-build.tssrc/renderer/src/runtime/web-session-tabs-sync/tracking-lifecycle.tssrc/renderer/src/store/terminals/terminal-tab-attention.tssrc/renderer/src/store/terminals/terminal-tab-title-runtime-mirror.test.tssrc/shared/rpc-contract/session-tabs-schemas-params.tssrc/shared/runtime-mobile-session-tab-contracts.tstests/e2e/session-tabs-custom-title-persistence.unit.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| args: { | ||
| tabId: string | ||
| color?: string | null | ||
| customTitle?: string | null |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
git diff --unified=80 67fc894c8eb94d82f7e44f7789f09039027fb893 b4ddda6f32f9647a7260e7b661544acf3e1489f0 -- src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts
printf '%s\n' '--- target method ---'
rg -n -C 35 'setMobileSessionTabProps|getAvailableAuthoritativeWindow|customTitle' src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts
printf '%s\n' '--- RPC references ---'
rg -n -C 20 'setMobileSessionTabProps' src/main/runtime
printf '%s\n' '--- title references ---'
rg -n -C 12 'customTitle|set.*Title|title.*tab|tab.*title' src/main/runtime src/mainRepository: stablyai/orca
Length of output: 45662
🏁 Script executed:
printf '%s\n' '--- RPC mutation method ---'
sed -n '1,240p' src/main/runtime/rpc/methods/session-tab-mutation-methods.ts
printf '%s\n' '--- authoritative-window references ---'
rg -n -C 18 'getAvailableAuthoritativeWindow' src/main/runtime
printf '%s\n' '--- focused customTitle references ---'
rg -n -C 10 'customTitle' src/main/runtime --glob '*.ts' --glob '!**/*.test.ts'
printf '%s\n' '--- mobile tab prop method references ---'
rg -n -C 12 'persistHeadlessSessionTabProps|applyHeadlessSessionTabPropsToSnapshot|setMobileSessionTabProps' src/main --glob '*.ts'Repository: stablyai/orca
Length of output: 45665
🏁 Script executed:
printf '%s\n' '--- customTitle source files ---'
rg -l 'customTitle' src --glob '*.ts' --glob '*.tsx' | sort
printf '%s\n' '--- setTabProps and client-kind routing ---'
rg -n -C 12 'session\.tabs\.setTabProps|clientKind|Remote Web|remote web|remoteWeb' src/main src/renderer src/shared --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' | head -n 500
printf '%s\n' '--- renderer/runtime title and tab-prop handlers ---'
rg -n -C 15 'customTitle|setTabProps|tabProps|sessionTabs' src/renderer src/main --glob '*.tsx' --glob '*.ts' --glob '!**/*.test.ts' | head -n 600Repository: stablyai/orca
Length of output: 42483
🏁 Script executed:
printf '%s\n' '--- web tab-props mutation ---'
sed -n '1,260p' src/renderer/src/runtime/web-runtime-tab-props-mutation.ts
printf '%s\n' '--- web terminal actions ---'
sed -n '1,280p' src/renderer/src/runtime/web-runtime-terminal-actions.ts
printf '%s\n' '--- renderer mirror helper ---'
sed -n '1,190p' src/renderer/src/store/terminals/terminal-tab-attention.ts
printf '%s\n' '--- remote session tab sync handlers ---'
rg -n -C 20 'setTabCustomTitle|customTitle|session\.tabs\.setTabProps|setTabProps' src/renderer/src/runtime src/renderer/src/store --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' | head -n 500Repository: stablyai/orca
Length of output: 42334
🏁 Script executed:
printf '%s\n' '--- web runtime environment routing ---'
sed -n '1,300p' src/renderer/src/runtime/web-runtime-session-environment.ts
printf '%s\n' '--- web tab props tests ---'
sed -n '1,320p' src/renderer/src/runtime/web-runtime-session-tab-props.test.ts
printf '%s\n' '--- host snapshot title handling ---'
rg -n -C 25 'customTitle|reconcileWebSessionCustomTitleIntent' src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts src/renderer/src/runtime/web-session-custom-title-intent.ts
printf '%s\n' '--- runtime environment call bindings ---'
rg -n -C 20 'runtimeEnvironments.*call|callEnvironment|runtimeEnvironment.*call' src/main src/renderer/src --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' | head -n 500Repository: stablyai/orca
Length of output: 42358
Apply Remote Web title writes when an authoritative window exists.
setWebRuntimeTabProps sends customTitle to session.tabs.setTabProps. When getAvailableAuthoritativeWindow() returns a live window, setMobileSessionTabProps returns { updated: true } before persisting the props or notifying the renderer. The authoritative renderer therefore keeps the old title, and a later snapshot can restore it after the optimistic client intent expires. Forward the title write to the authoritative renderer, or report that the write was not applied.
|
I prepared a follow-up for this PR's desktop-to-desktop Remote path (related to #22543), based on your current head b4ddda6. Commit: 963be7f6f. It preserves optional Six regression checks failed before the fix. The final focused run passed 30 tests, including 11 added checks for publication, clear/legacy behavior, split title isolation, desktop mutation routing and a missing rename bridge. An independent reviewer found no remaining blocking issues. Full Node/Web typechecks, the expanded original PR suites and the type-aware quality stage did not complete; I stopped those processes. Ordinary/casting/focused-plugin scans found zero new findings. A live Windows-to-Mac session has not been tested. Renderer acknowledgement retains the existing CLI rename semantics. Please feel free to cherry-pick the commit into this PR. I have not opened a competing PR. |
|
I updated the same contribution branch with this PR, the desktop Remote follow-up, and upstream main at 79a8cff. Ready-to-integrate branch: batonsky/remote-tab-titles-fix, head 56e6af3. This is a forward-only update containing your current PR head; it does not rewrite your commits. Please merge the branch into this PR rather than cherry-picking the integration merge alone. The single conflict is resolved while preserving both title and customTitle. Review also caught an interaction with main's provisioning title path: it now publishes the same customTitle it persists, so a Remote client receives the provisioned name immediately. Validation: 75 tests passed across eight files, including new live-snapshot/client/restart coverage and title-only/rename/clear checks. Independent review found no remaining blocking issues. All changed-code quality stages except the type-aware scan passed with zero new findings; git diff --check passed. Full Node/Web typechecks and the type-aware scan did not complete and were stopped. One test retry hit temporary ENOSPC; the final corrected suite passed. Live Windows-to-Mac testing remains outstanding. No competing PR was opened. |

ELI5
Renaming a terminal tab in Remote Web UI now saves the name on the Orca host, so every connected Web client sees the same title and it remains after refresh or host restart.
What Changed
Why
Remote Web terminal renames previously lived only in one renderer, so the next host snapshot, browser refresh, or host restart restored the old title. Extending the existing tab-props mutation and snapshot flow keeps the host authoritative without introducing a parallel RPC or stream opcode.
Linked Issue
Fixes #17640
Visual Proof
N/A
No layout or visual styling changed; this fixes persistence and synchronization of the existing inline rename behavior, which is covered by the rendered Playwright check below.
Testing
Current head bf895ebd916ccc0d6f891bf3878434bcf6f558e6 after rebase onto current main:
On the pre-rebase implementation head, pnpm exec electron-vite build --mode e2e passed with only existing warnings, and the Playwright CDP rendered smoke passed 1/1. These heavier checks were not repeated after the conflict resolution; the current-head focused tests, typecheck, and changed-code quality passed.
AI Disclosure
OpenAI Codex from the GPT-5 family was used for implementation, test creation, review follow-up, and PR description updates. The resulting changes and reviewer findings were inspected and validated with the checks listed above.
Review
Agent skill upstream boundary
Notes
Checklist