Skip to content

feat(cli): set the title of one terminal pane - #24755

Closed
nwparker wants to merge 4 commits into
mainfrom
nwparker/sweep-22750-pane-title-cli
Closed

nwparker wants to merge 4 commits into
mainfrom
nwparker/sweep-22750-pane-title-cli

Conversation

@nwparker

@nwparker nwparker commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​403 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​398
Prod 34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​382 $\color{#cf222e}{\Huge{\mathbf{−}}}$​175 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​207

ELI5

A split terminal can now keep its own label, such as REVIEWER, using the CLI. Naming one pane leaves the other panes and the tab name alone.

What Changed

Adds orca terminal set-pane-title --terminal <handle> --title "REVIEWER"; --title "" clears that pane back to its automatic title. Before, the CLI rejected this command and terminal rename only named the whole tab. That existing rename behavior stays the same.

The runtime checks the live handle and sends the pane's saved leaf ID to the desktop. Mounted panes use the same setter as the GUI's Set Title action; parked panes update the same titlesByLeafId layout so their next mount sees the title. Stale handles and leaves are rejected without changing a sibling. The preload hook is optional and an older host's unknown-method error is returned safely.

Why

Agents can label side-by-side roles without waiting for GUI input or relying on an agent's changing status title. Reusing the saved pane identity and layout keeps GUI and CLI titles consistent across reloads; a second title store or tab rename would not meet that contract. Terminal command specs move unchanged into their own module to keep the existing file-size limit.

Linked Issue

Fixes #22750

Local CLI/RPC/preload/event plumbing is adapted from @CodeHourra's #22751, authored by stevelliu ([email protected]) and credited in the commit. That contributor PR is untouched. Its headless and remote resolution are excluded from this focused local change.

Visual Proof

Before invoking the command: the sibling already has DEVELOPER and the target uses its automatic title. The baseline CLI's separate command capture returns Unknown command: terminal set-pane-title.

Before invoking the command

After invoking it on the target handle: only that pane becomes REVIEWER.

After setting the target pane title

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Real hidden Electron on macOS with a disposable home/profile and repository: split a tab, title one handle, title its sibling, clear the target, set it again, switch workspaces, reload, and verify each saved title stays with its own pane. Also set/clear with the target pane unmounted through the existing manual parking flow, restore it, and reload after clearing; DEVELOPER remains and the cleared title stays absent. A handle from the previous runtime returns terminal_handle_stale with the layout unchanged. Real terminal rename changes only the tab name.

Reproduce: terminal split --terminal <handle> --direction horizontal --json, then terminal set-pane-title --terminal <split.handle> --title REVIEWER --json; clear with --title "" and reload. All apps/tests use ORCA_BACKGROUND_LAUNCH=1; no desktop windows were shown or focused.

70 scoped tests pass, covering CLI parsing and old-host refusal, runtime stale handles and unchanged rename, renderer leaf checks and cleanup, parked layouts, RPC manifest and IPC lifecycle. pnpm tc, changed-file oxlint, formatting, changed-code-quality, generated RPC catalog and bundled guide checks pass. The CLI and hidden Electron development build pass. Linux/Windows rendered acceptance and SSH execution were not run locally; current-head CI is reported separately.

Fresh final-source macOS verification at 0068986694642a752446f2f03a6a92eea60766d0: the actual built CLI targeted a fresh hidden Electron instance, with each command checking the owned app PID. One test passed with no skips or retries. It verifies mounted title normalization/rendering, an untouched sibling and whole-tab title, a genuinely parked pane update, committed database readback, remount, clean owned app quit/relaunch, and empty-title clearing of only the addressed pane. Four raw renderer screenshots were inspected. All 41 feature files, generated output and sampled native dependencies stayed unchanged; owned apps exited and the isolated profile was removed. This closes the normal macOS application/persistence gap. It does not claim a cold terminal-daemon restart, Windows/Linux flow, renderer-reload races or persistence-write failures.

The success receipt still acknowledges desktop IPC emission, without a renderer or durable-persistence acknowledgment. A stale layout/leaf can be discarded by the renderer. The passing flow does not turn that receipt into a stronger guarantee.

Review

Independent read-only review found a lost update when the initial event-only implementation targeted an unmounted pane. A parked-layout test failed before the fix; the revised existing-layout write and mounted setter passed re-review and all scoped tests. Review covered identity reuse, persistence, sibling isolation, old-runtime/preload compatibility, cleanup, unchanged rename, performance and basic security. No agent-specific behavior, UI styles, process execution or remote routing changed.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Merge risk is low–moderate after actual CLI, renderer, parked-pane, persistence and clean app-restart verification on macOS. Success still acknowledges IPC emission; a renderer/layout race or persistence failure is not reported back to the CLI. A bounded renderer acknowledgment would be needed for a stronger success guarantee. The shared additions are optional; this adds no stream opcode or SSH repair and uses the existing layout authority. Negative user-facing tradeoffs for existing flows: none identified. The new command requires a running supported desktop; headless/remote title setting is outside this PR. Titles are trimmed, matching the GUI. The CLI's terminal list title remains the automatic terminal title, as it does for GUI custom pane labels.

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

Reuse durable leaf identity and the existing GUI title setter and persisted layout. Keep terminal rename tab-scoped and preserve parked-pane updates.

Co-authored-by: stevelliu <[email protected]>
@pullfrog

pullfrog Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Pullfrog stalled

The agent stopped emitting events for 125s and was killed by the activity-timeout watchdog. The model produced no output at all before the stall — the request was sent but nothing came back. This is usually transient; re-running often succeeds.

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: 1465c53a-f3ab-414a-9bad-51ed5df187d5
📥 Commits

Reviewing files that changed from the base of the PR and between 8cd9751 and 0068986.

⛔ Files ignored due to path filters (1)
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (40)
  • docs/site/content/docs/cli/reference.mdx
  • skill-guides/orca-cli.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/format.ts
  • src/cli/handler-group-manifest.ts
  • src/cli/handlers/terminal-set-pane-title.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/root-help-text-primary.ts
  • src/cli/specs/core.ts
  • src/cli/specs/terminal-set-pane-title.ts
  • src/cli/specs/terminal.ts
  • src/cli/terminal-format.ts
  • src/main/runtime/orca-runtime-persist-headless-terminal-title.ts
  • src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts
  • src/main/runtime/rpc/methods/terminal-manifest-characterization.test.ts
  • src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts
  • src/main/runtime/rpc/methods/terminal/unary-schemas.ts
  • src/main/runtime/runtime-notifier-contract.ts
  • src/main/runtime/runtime-terminal-set-pane-title.test.ts
  • src/main/window/runtime-window-lifecycle.ts
  • src/main/window/runtime-window-pane-title-notification.test.ts
  • src/preload/api/ui-bridge-clipboard-and-window-controls.ts
  • src/preload/api/ui-command-event-api.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-types.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-mount-events.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-set-title-event.test.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-actions.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle-stage.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-mount-lifecycle.ts
  • src/renderer/src/constants/terminal.ts
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.ts
  • src/renderer/src/hooks/useIpcEvents-lifecycle.test.ts
  • src/renderer/src/web/preload-api/web-ui-api.ts
  • src/shared/rpc-contract/terminal-unary-params.ts
  • src/shared/runtime-terminal-contracts.ts
  • src/shared/runtime-terminal-title-contracts.ts
  • src/shared/runtime-types.ts

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


📝 Walkthrough

Walkthrough

The change adds orca terminal set-pane-title, which sets or clears the title of the pane associated with a terminal handle. The RPC validates the title and routes the request through the runtime to the renderer using durable tab and leaf IDs. The renderer updates the pane title and layout. The CLI help, command reference, and skill guide document the command.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 00689

The pane-title change is mergeable after normal checks; no material unresolved issue was identified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 00689

The inspected changes are limited to pane labels, with checks intended to prevent updates to the wrong pane. No concrete security defect was established. Successful delivery does not establish that a label was applied or saved before a reload or interruption.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A credentialed runtime-scoped client may reach the new method when its target runtime has a usable desktop window and live pane identity. The inspected operation affects the addressed pane label; it does not itself write terminal input, change execution privileges, or mutate sibling title entries. End-to-end remote desktop exposure was not fully demonstrated.

Trust Boundaries and Controls

  • observed — Remote dispatch rejects missing, invalid, or mismatched device credentials and applies a method allowlist to mobile-scoped devices. The inspected terminal allowlist includes rename and send but not setPaneTitle. Local request admission calls parseAndAuth before dispatch, although that authentication implementation was not inspected.

Resilience and Maintainability Implications

  • observed — Missing layouts, invalid leaf IDs, absent layout members, other-tab events, and numeric-pane ownership mismatches are rejected by renderer consumers. Mounted listeners are removed during cleanup. These controls constrain misrouting despite pane lifecycle changes, without proving durability across interruption.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 37 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #22750 requires a CLI command that sets or clears one pane title, persists it by durable leaf ID in titlesByLeafId, and leaves sibling panes unchanged. The PR adds terminal set-pane-title, r…
Out of Scope Changes check ✅ Passed The CLI, RPC, preload, renderer, layout, test, and documentation changes support issue #22750. The terminal-spec reorganization supports the CLI integration. The rename-related runtime changes preserv…
Title check ✅ Passed The title clearly and concisely identifies the main change: adding a CLI command to set one terminal pane’s title.
Description check ✅ Passed The description covers the required sections and explains the user-facing change, rationale, linked issue, visual proof, testing, review findings, scope limits, and checklist. The AI Disclosure sectio…
Full details: Docstring Coverage

Explanation

Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 37 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Re-reviewed PR #24755 after 701a482e45 ("Resolve current CLI specs and reject failed pane title notifications"), which merged main 752871bd and added the delivery-receipt fix on top of 4a6adc388b.

  • Split terminal command specs into their own module — moved the inline terminal specs out of src/cli/specs/core.ts into src/cli/specs/terminal.ts to keep the file under its size limit; every prior spec is preserved in order, with set-pane-title added.
  • Made pane-title delivery report failure — RuntimeNotifier.setPaneTitle now returns a boolean and OrcaRuntime.setPaneTitle throws runtime_unavailable when the desktop refuses or drops the notification, instead of returning a success result for a title that never reached the renderer.
  • Added receipt and mapping tests — new tests cover the main-window sender's true/false receipts (including the disposed-frame latch) and the RPC dispatcher mapping the thrown error to the runtime_unavailable failure code.
  • Synced bundled and source skill guides — skill-guides/orca-cli.md and the generated src/cli/bundled-skill-guides.ts both carry the set-pane-title entry.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker

Copy link
Copy Markdown
Contributor Author

Superseded by #30485. This branch was about 2,400 commits behind main and conflicted in 16 files, so the same change was rebuilt on a fresh branch. The contributor co-author credit is kept.

@nwparker nwparker closed this Oct 19, 2026
nwparker added a commit that referenced this pull request Oct 19, 2026
* feat(cli): set the title of one terminal pane

Adds `orca terminal set-pane-title --terminal <handle> --title <text>`; `--title ""`
clears it. The runtime resolves the live handle to its saved leaf and asks the
desktop window to name that pane through a new optional notifier hook
(`ui:setPaneTitle`). Mounted panes apply it through the same local setter the GUI
uses; parked panes get it in the saved layout their next mount reads. The tab's
own name is never touched.

Rebuilt on current main from #24755.

Co-authored-by: stevelliu <[email protected]>

* fix(renderer): a main-owned layout takes a CLI pane title before the window shows it

* fix(renderer): a CLI pane title reaches a never-mounted tab with a rootless layout

---------

Co-authored-by: stevelliu <[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.

[Feature]: let the CLI set the title of a single terminal pane

1 participant