Skip to content

fix(terminal): mirror pane renames to the owning runtime - #30333

Closed
wangshifeng wants to merge 2 commits into
stablyai:mainfrom
wangshifeng:fix/web-pane-rename-host-sync
Closed

wangshifeng wants to merge 2 commits into
stablyai:mainfrom
wangshifeng:fix/web-pane-rename-host-sync

Conversation

@wangshifeng

@wangshifeng wangshifeng commented Oct 18, 2026 •

Copy link
Copy Markdown

ELI5

When you rename a terminal pane in Orca Web, the new name only lived in that browser tab. This PR also tells the Orca host, so orca terminal list, other clients, agents, and dashboards see the same name.

What Changed

  • Added syncPaneTerminalTitle (src/renderer/src/runtime/pane-terminal-title-sync.ts).
  • changePaneTitle now mirrors the title to the owning runtime after the local title is applied:
    • resolve the pane via terminal.resolvePane (paneKey = tabId:leafId),
    • call terminal.rename with the resolved handle (same path as the CLI).
  • Owner routing uses runtimeEnvironmentIdForWorkspaceOwner; when the owner is ambiguous, synchronization is skipped instead of falling back to the local runtime.
  • Works for both local and paired remote runtimes.
  • Clearing a pane title forwards title: null.
  • The mirror is fire-and-forget; failures log a warning and never block the UI.
  • Rapid edits are serialized per pane, so an older resolve/rename cannot overwrite a newer title.
  • Tests: helper unit tests (local/remote/ambiguous/no-pane/clear/rapid edits) and a call-site test in the layout-persistence suite.

Why

Pane titles are renderer layout state. The existing remote-layout push is gated on hasRemotePane (isRemoteRuntimePtyId), so a host-local PTY never sends titlesByLeafId; even when it does, updateMobileSessionPaneLayout early-returns when an authoritative desktop window exists. The host therefore keeps reporting the old title, and any host-side consumer (CLI, exporters, dashboards, agents addressing sessions by name) disagrees with the UI.

Routing the rename through terminal.rename updates the terminal summary directly, which is exactly what orca terminal rename already does. This avoids changing layout ownership rules and works for single- and multi-pane tabs.

Related but distinct: #19582 / #19583 and #17644 cover tab-level customTitle; this is pane-level titlesByLeafId.

On layout persistence (titlesByLeafId)

terminal.list is built from the PTY/tab title (terminal.rename sets pty.pty.title; mobile-session-terminal-projection.ts uses tab-level title fields), not titlesByLeafId. Replacing terminal.rename with session.tabs.updatePaneLayout would persist the layout but leave the reported terminal.list / exporter / dashboard symptom stale. updatePaneLayout also intentionally skips when an authoritative window owns the layout.

Follow-up issue: #30386 (linked to the in-flight tab-title work in #19583 / #17644).

Linked Issue

Fixes #30329

Visual Proof

N/A — no visual change; the Orca UI already showed the new title. Before/after behavior on the host:

before: term_123  <old generated title>
after:  term_123  <new title>

Testing

  • vitest: src/renderer/src/runtime/pane-terminal-title-sync.test.ts and src/renderer/src/components/terminal-pane/terminal-layout-gesture-persist.test.tsx — 12 tests pass.
  • Terminal-pane suite: 538/539 files pass (5460 tests); one unrelated alt-screen hook hit a 60s timeout in this environment.
  • oxlint (both repo configs) and oxfmt pass on the changed files via lint-staged.
  • Changed files typecheck clean (tsc -p config/tsconfig.web.json --noEmit).
  • Full pnpm lint/typecheck/test/build not completed locally (this checkout lacks some optional native bindings); CI will cover.

AI Disclosure

Claude Code (Anthropic) was used to investigate the rename path, draft the patch, and write the tests.

Review

  • Cross-platform: renderer-only; no platform-specific branches. The runtime RPC is available on macOS/Linux/Windows hosts.
  • Remote/SSH/local: target selection uses the existing worktree owner resolution; local, environment, and ambiguous owners are covered by tests. Direct-SSH remotes keep their current behavior.
  • Performance: one resolvePane plus one rename per user rename; fire-and-forget, serialized per pane, no hot path.
  • Security: uses existing workspace-permission RPCs; no new trust boundary; titles pass through the existing TerminalRename contract.
  • UI quality: no visual or interaction change.

Agent skill upstream boundary

  • Not applicable

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, pnpm build pass (targeted checks pass; full run left to CI)

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7da96a34-353f-4d63-bde1-dc6a30c74667
📥 Commits

Reviewing files that changed from the base of the PR and between 1aff58f and a393a4c.

📒 Files selected for processing: 2
  • src/renderer/src/runtime/pane-terminal-title-sync.test.ts
  • src/renderer/src/runtime/pane-terminal-title-sync.ts
🚧 Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/runtime/pane-terminal-title-sync.test.ts
  • src/renderer/src/runtime/pane-terminal-title-sync.ts

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

📝 Walkthrough

Pane title changes now call runtime synchronization. The sync function resolves the terminal and sends its title to the worktree’s environment runtime when available, or to the local runtime otherwise. If no terminal is resolved, it does not rename it. The pane layout persistence hook logs a warning if synchronization fails. Tests cover runtime selection, missing terminals, null titles, ordered renames, and changed or removed pane titles.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to a393a

A pane title changed in Web can disappear after reload. Resolve host persistence before merging unless that limitation is explicitly accepted.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #30329 requires pane-level renames to reach the owning host. The PR applies the local title, resolves the pane with terminal.resolvePane, and mirrors the title with terminal.rename. It sends…
Out of Scope Changes check Passed The changes support issue #30329. The helper, call-site integration, warning handling, serialization, and tests implement host synchronization for pane-level titles. The PR does not change tab-level `…
Title check Passed The title clearly and concisely describes the primary change: mirroring terminal pane renames to the owning runtime.
Description check Passed The description covers the required sections, explains the user impact and implementation, links issue #30329, provides visual-proof rationale, documents targeted testing and limitations, and addresse…
Full details: Linked Issues check

Explanation

Issue #30329 requires pane-level renames to reach the owning host. The PR applies the local title, resolves the pane with terminal.resolvePane, and mirrors the title with terminal.rename. It sends title: null when the title is cleared. It routes local and paired remote owners, skips ambiguous owners, and serializes rapid renames per pane. The added tests cover these routing and ordering cases.

Full details: Out of Scope Changes check

Explanation

The changes support issue #30329. The helper, call-site integration, warning handling, serialization, and tests implement host synchronization for pane-level titles. The PR does not change tab-level customTitle behavior or layout ownership rules.

Full details: Description check

Explanation

The description covers the required sections, explains the user impact and implementation, links issue #30329, provides visual-proof rationale, documents targeted testing and limitations, and addresses review concerns. The full command checklist remains unchecked, but the limitation is clearly explained and CI coverage is noted.

  • Fix all pre-merge checks with AI
  • 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 75758434-f407-4c7d-9fd5-98dec596b363
📥 Commits

Reviewing files that changed from the base of the PR and between aa07d58 and 8346c0c39ef8a033d3a1695a8e74ce4235e15fbc.

📒 Files selected for processing: 4
  • src/renderer/src/components/terminal-pane/terminal-layout-gesture-persist.test.tsx
  • src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts
  • src/renderer/src/runtime/pane-terminal-title-sync.test.ts
  • src/renderer/src/runtime/pane-terminal-title-sync.ts

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

@@ -203,6 +204,11 @@ export function useTerminalPaneLayoutPersistence(controller: TerminalPaneStartup
const showTitle = (): void =>
title === null ? removePaneTitleLocally(paneId) : setPaneTitleLocally(paneId, title)
const leafId = managerRef.current?.getPanes().find((pane) => pane.id === paneId)?.leafId
if (leafId) {
void syncPaneTerminalTitle({ worktreeId, tabId, leafId, title }).catch((error: unknown) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- target hook ---'
nl -ba src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts | sed -n '150,240p'
printf '%s\n' '--- symbols ---'
rg -n -F --glob '*.{ts,tsx}' -e 'sendLayoutCommandToOwner' -e 'syncPaneTerminalTitle' -e 'ORCA_LAYOUT_OWNER_IS_MAIN' src || test "$?" -eq 1
printf '%s\n' '--- relevant test names/content ---'
rg -n -i --glob '*.{test,spec}.{ts,tsx}' -e 'sendLayoutCommandToOwner' -e 'syncPaneTerminalTitle' -e 'accepted' -e 'apply' src/renderer/src/components src/renderer/src/runtime || test "$?" -eq 1
printf '%s\n' '--- changed-file diff ---'
git diff --no-ext-diff aa07d5891a402a2f98cc1e56d22a2b30d4f15542 8346c0c39ef8a033d3a1695a8e74ce4235e15fbc -- src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts
printf '%s\n' '--- sync helper definitions ---'
rg -n -F --glob '*.{ts,tsx}' -e 'export async function syncPaneTerminalTitle' -e 'function syncPaneTerminalTitle' -e 'const syncPaneTerminalTitle' src || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 45667


🏁 Script executed:

set -eu
printf '%s\n' '--- exact owner-command references ---'
rg -n -F -- 'sendLayoutCommandToOwner' src/renderer src/shared src/main || test "$?" -eq 1
printf '%s\n' '--- owner-command imports/definitions ---'
rg -n -F -- 'function sendLayoutCommandToOwner' src || test "$?" -eq 1
rg -n -F -- 'const sendLayoutCommandToOwner' src || test "$?" -eq 1
rg -n -F -- 'export { sendLayoutCommandToOwner' src || test "$?" -eq 1
printf '%s\n' '--- sync helper and focused tests ---'
nl -ba src/renderer/src/runtime/pane-terminal-title-sync.ts
rg -n -F -- 'pane-terminal-title-sync' src/renderer src/shared src/main || test "$?" -eq 1
rg -n -F -- 'renamePane' src/renderer/src/components/terminal-pane src/renderer/src/store src/shared/workspace-layout src/main/runtime | head -120 || true
printf '%s\n' '--- owner-related layout test files ---'
rg --files src | rg 'layout-owner|workspace-layout-command|terminal-pane-layout-persistence|pane-terminal-title'

Repository: stablyai/orca

Length of output: 24237


🏁 Script executed:

set -eu
printf '%s\n' '--- owner command implementation ---'
nl -ba src/renderer/src/runtime/layout-owner-command.ts
printf '%s\n' '--- owner command tests ---'
nl -ba src/renderer/src/runtime/layout-owner-command.test.ts | sed -n '1,240p'
printf '%s\n' '--- gesture persistence test ---'
nl -ba src/renderer/src/components/terminal-pane/terminal-layout-gesture-persist.test.tsx | sed -n '1,230p'
printf '%s\n' '--- hook imports and surrounding declarations ---'
nl -ba src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts | sed -n '1,45p'
nl -ba src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts | sed -n '185,230p'

Repository: stablyai/orca

Length of output: 22248


🏁 Script executed:

set -eu
printf '%s\n' '--- layout apply send implementation ---'
nl -ba src/renderer/src/runtime/layout-apply-send.ts
printf '%s\n' '--- layout apply type/callback declarations ---'
rg -n -F -- 'export type LayoutApplyHandlers' src/renderer/src/runtime src || test "$?" -eq 1
rg -n -F -- 'type LayoutApplyHandlers' src/renderer/src/runtime src || test "$?" -eq 1
printf '%s\n' '--- callback usage around sendLayoutApply ---'
rg -n -F -- 'sendLayoutApply' src/renderer/src/runtime src/renderer/src/components | head -80 || true

Repository: stablyai/orca

Length of output: 14601


Sync the runtime title only after applying the local title.

sendLayoutCommandToOwner returns before its RPC completes. A failed RPC calls refused('call_failed') without invoking apply or asToday, but the current code has already started syncPaneTerminalTitle. Move the sync into the title-application callback and preserve the immediate window-owned path.

🐛 Suggested fix
--- "a/src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts"
+++ "b/src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts"
@@ -201,27 +201,30 @@
   /** A user's title for a pane, trimmed and non-empty; null clears it. */
   const changePaneTitle = useCallback(
     (paneId: number, title: string | null) => {
       const showTitle = (): void =>
         title === null ? removePaneTitleLocally(paneId) : setPaneTitleLocally(paneId, title)
       const leafId = managerRef.current?.getPanes().find((pane) => pane.id === paneId)?.leafId
-      if (leafId) {
-        void syncPaneTerminalTitle({ worktreeId, tabId, leafId, title }).catch((error: unknown) => {
-          console.warn('[terminal-pane] failed to sync pane title to runtime:', error)
-        })
-      }
+      const showTitleAndSync = (): void => {
+        showTitle()
+        if (leafId) {
+          void syncPaneTerminalTitle({ worktreeId, tabId, leafId, title }).catch((error: unknown) => {
+            console.warn('[terminal-pane] failed to sync pane title to runtime:', error)
+          })
+        }
+      }
       // Switch point: main renames the pane first; the window then shows the title.
       if (
         ORCA_LAYOUT_OWNER_IS_MAIN &&
         leafId &&
         sendLayoutCommandToOwner(
           worktreeId,
           { type: 'renamePane', tabId, leafId, title },
-          { apply: showTitle, asToday: showTitle }
+          { apply: showTitleAndSync, asToday: showTitleAndSync }
         )
       ) {
         return
       }
-      showTitle()
+      showTitleAndSync()
     },
     // oxlint-disable-next-line react-hooks/exhaustive-deps -- Refs are stable.
     [removePaneTitleLocally, setPaneTitleLocally, tabId, worktreeId]

if (!resolved.terminal) {
return
}
await callRuntimeRpc(target, 'terminal.rename', {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,110p' src/renderer/src/runtime/pane-terminal-title-sync.ts
sed -n '194,230p' src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts
rg -n "'terminal.rename'|'terminal.resolvePane'|terminal\.rename" src/main src/renderer/src/runtime src/shared | head -90

Repository: stablyai/orca

Length of output: 7044


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- runtime RPC client and related queueing ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'export async function callRuntimeRpc' -e 'function callRuntimeRpc' -e 'class .*Queue' -e 'serialize' -e 'enqueue' src/renderer/src/runtime src/shared src/main/runtime | head -160
printf '%s\n' '--- runtime RPC client source ---'
client=$(rg -l -F --glob '*.ts' -- 'export async function callRuntimeRpc' src/renderer/src/runtime | head -1)
if [ -n "$client" ]; then
  sed -n '1,240p' "$client"
fi
printf '%s\n' '--- terminal query/rename methods ---'
sed -n '1,190p' src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts
printf '%s\n' '--- direct rename receiver and callers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'renameTerminal' -e 'terminal.rename' -e 'rename(' src/main/runtime src/shared | head -220
printf '%s\n' '--- sync helper callers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'syncPaneTerminalTitle' src/renderer/src

Repository: stablyai/orca

Length of output: 42160


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- callRuntimeRpc implementation ---'
sed -n '1,220p' src/renderer/src/runtime/runtime-rpc-client.ts
printf '%s\n' '--- environment transport and queue references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'callRuntimeEnvironmentWithRevision' -e 'RuntimeRpcCallQueue' -e 'runtimeRpcCallQueue' -e 'new RuntimeRpcCallQueue' -e 'queue.enqueue' src/renderer/src/runtime src/main/runtime src/shared | head -180
printf '%s\n' '--- queue implementation and tests ---'
rg -l -F --glob '*.ts' -- 'class RuntimeRpcCallQueue' src/shared src/main src/renderer | while read -r f; do echo "FILE $f"; sed -n '1,240p' "$f"; done
printf '%s\n' '--- renameTerminal declarations and implementations ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'async renameTerminal' -e 'renameTerminal(handle' -e 'renameTerminal(' src/main/runtime | head -160

Repository: stablyai/orca

Length of output: 32064


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- environment RPC call ---'
sed -n '1,260p' src/renderer/src/runtime/runtime-rpc-environment-call.ts
printf '%s\n' '--- queue construction and enqueue bindings ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'RuntimeRpcCallQueuePool' -e 'new RuntimeRpcCallQueuePool' -e '.enqueue(selector' -e '.enqueue(environment' src/main src/renderer src/shared | head -220
printf '%s\n' '--- local runtime.call registration/handler ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e \"runtime.call\" -e \"'runtime:call'\" -e 'runtimeCall' src/main src/renderer src/shared | head -180
printf '%s\n' '--- runtime rename receiver ---'
sed -n '180,285p' src/main/runtime/workspaces/workspace-removal-target.ts
printf '%s\n' '--- runtime rename declaration context ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'class OrcaRuntime' -e 'renameTerminal(handle' -e 'renameTerminal(' src/main/runtime/orca-runtime.ts src/main/runtime | head -120

Repository: stablyai/orca

Length of output: 41816


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- main environment call queue wrapper ---'
cat src/main/ipc/runtime-environment-call-queue.ts
printf '%s\n' '--- callers of enqueueRuntimeEnvironmentCall ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'enqueueRuntimeEnvironmentCall' -e 'runtimeEnvironmentCallQueue' -e 'runtimeEnvironments.call' src/main src/renderer | head -180
printf '%s\n' '--- IPC registration around runtime environment calls ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'runtimeEnvironments' -e 'runtime-environments' src/main/ipc src/main | head -220
printf '%s\n' '--- complete rename mutation ---'
sed -n '205,275p' src/main/runtime/workspaces/workspace-removal-target.ts
printf '%s\n' '--- terminal RPC method context ---'
sed -n '105,140p' src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts

Repository: stablyai/orca

Length of output: 42686


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- active queue binding ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'enqueueRuntimeCall' src/main src/renderer src/shared
printf '%s\n' '--- runtime environment call handler ---'
rg -l -F --glob '*.ts' -- 'runtimeEnvironments:call' src/main/ipc | while read -r f; do
  echo "FILE $f"
  rg -n -F -C 12 -- 'runtimeEnvironments:call' "$f"
done
printf '%s\n' '--- local runtime call handlers and dispatch ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'runtime:call' -e 'runtime.call' -e 'ipcMain.handle' src/main/ipc src/main/window | head -180

Repository: stablyai/orca

Length of output: 37392


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- paired transport queue call ---'
sed -n '1,105p' src/main/ipc/runtime-environment-transport-routing.ts
printf '%s\n' '--- local runtime IPC handler ---'
sed -n '1,120p' src/main/ipc/runtime.ts
printf '%s\n' '--- runtime RPC server dispatch ---'
sed -n '1,180p' src/main/runtime/runtime-rpc.ts

Repository: stablyai/orca

Length of output: 11411


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- remote RPC request dispatch ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'sendRemoteRuntimeRequest' -e 'RpcDispatcher' -e 'dispatch(' src/main src/shared | head -220
printf '%s\n' '--- remote runtime server request handlers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'runtimeRpc' -e 'remote runtime' -e 'incoming' src/main/runtime/runtime-rpc src/main | head -220

Repository: stablyai/orca

Length of output: 41252


Serialize title synchronization per pane.

Rapid title changes can overlap. changePaneTitle starts each synchronization independently, and the RPC paths do not serialize requests per pane. The second terminal.resolvePane can complete first, so the older terminal.rename can overwrite the newer host title.

Serialize the complete resolve-and-rename operation by pane key. This is a narrow race in the title integration path, so the issue is minor rather than major.

Pane titles live in the renderer layout. On a Web client (and on paired
clients with local PTYs) the layout push is gated on a remote ptyId, so a
pane rename never reached the host and `terminal.list` kept reporting the
old title. Mirror the rename through the same `terminal.resolvePane` +
`terminal.rename` path the CLI uses, for both local and environment
runtimes. Clearing a title forwards null.

Fixes stablyai#30329
@wangshifeng
wangshifeng force-pushed the fix/web-pane-rename-host-sync branch from 8346c0c to 1aff58f Compare October 18, 2026 11:35
@wangshifeng

Copy link
Copy Markdown
Author

Updated to address the review:

  • The mirror now runs only after the local title is applied (inside the owner apply/asToday callbacks), so a refused owner command no longer updates the host.
  • Resolve + rename are serialized per pane, so rapid edits cannot let an older response overwrite a newer title.
  • Added a rapid-edit regression test; targeted tests now 11.

@wangshifeng

Copy link
Copy Markdown
Author

The two review points are addressed in 1aff58f:

  • The mirror now runs only after the local title is applied (inside the owner apply/asToday callbacks), so a refused owner command no longer updates the host.
  • Resolve + rename are serialized per pane, so rapid edits cannot let an older response overwrite a newer title.
  • Added a rapid-edit regression test; targeted tests are 11/11 passing.

@coderabbitai review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a69412c9-6e06-4153-a44f-946aad55aac7
📥 Commits

Reviewing files that changed from the base of the PR and between 8346c0c39ef8a033d3a1695a8e74ce4235e15fbc and 1aff58f.

📒 Files selected for processing: 3
  • src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts
  • src/renderer/src/runtime/pane-terminal-title-sync.test.ts
  • src/renderer/src/runtime/pane-terminal-title-sync.ts

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

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

getRuntimeEnvironmentIdForWorktree is read-only and collapses an ambiguous
owner to null, which made the mirror fall back to the local runtime. Use
runtimeEnvironmentIdForWorkspaceOwner and skip synchronization when the
owner is ambiguous; local and direct-SSH owners keep the existing path.
@nwparker

Copy link
Copy Markdown
Contributor

Thank you @wangshifeng, both for this PR and for the careful root-cause write-up in #30329. I'm closing this in favour of #30433, which builds on your investigation and credits you as co-author.

Why not merge this one: terminal.rename is a tab rename, not a pane rename.

So naming one pane of a split would rename the whole tab everywhere. That includes the user's own desktop, because a local worktree routes to the local runtime. Clearing a pane name would also wipe the tab's manual name.

What #30433 does instead:

  • It keeps the host's saved titlesByLeafId as the single record. Paired and web clients already push it, and headless hosts already persist it.
  • terminal.list and terminal.show gain an optional paneTitle read from that record, and the CLI list prints it.
  • Clearing the last pane name now sends {}. Before, it sent nothing, which hosts read as "unchanged".

Hosts that have their own desktop window still need a follow-up to pass client pane names on to that window. That work is tracked under #30386.

@nwparker nwparker closed this Oct 18, 2026
nwparker added a commit that referenced this pull request Oct 18, 2026
…ring the last one sticks (#30433)

A client's pane rename already lands in the host's saved layout (titlesByLeafId),
but terminal.list/show never read it, and clearing a remote tab's last pane title
sent no titles at all, which every host reads as 'unchanged'.

- terminal summaries carry an optional paneTitle from the host's saved layout;
  the CLI list prints it ahead of the terminal title. Older hosts omit it.
- clearing the last pane title of a remote tab pushes titlesByLeafId: {}, which
  old and new hosts both persist as cleared.

Supersedes #30333, which renamed the whole tab via terminal.rename.

Co-authored-by: wangshifeng <[email protected]>
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.

Pane-level terminal rename in Orca Web is not synced to the host

2 participants