Repository navigation
feat(cli): open a browser tab in a split pane with tab create --split - #35665
Conversation
[Medium impact] This PR appears safe to merge; no actionable issues were found. SummaryAdds
PR author
|
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 3

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:
376b57b3-6ce4-4f30-98dc-d0ca4a92a759
Files selected for processing: 17-
skill-guides/orca-cli/references/browser.mdsrc/cli/browser.test.tssrc/cli/bundled-skill-guides.tssrc/cli/handlers/browser-tab.tssrc/cli/specs/browser-basic.tssrc/main/browser/desktop-browser-bridge/desktop-browser-bridge-executor.test.tssrc/main/browser/desktop-browser-bridge/desktop-browser-bridge-executor.tssrc/main/runtime/browser/browser-tab-creation.tssrc/main/runtime/browser/browser-tab-renderer-create.tssrc/preload/api/ui-bridge-state-and-menu-commands.tssrc/preload/api/ui-command-event-api.tssrc/renderer/src/hooks/ipc-events/browser-request-ipc-bridge.split.test.tssrc/renderer/src/hooks/ipc-events/browser-request-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/browser-tab-split-placement.tssrc/shared/browser-tab-create-request.tssrc/shared/browser-tab-split-direction.tssrc/shared/rpc-contract/browser-tab-create-params.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.
-
39fa85c to
ddfc4ec
Compare
There was a problem hiding this comment.
Actionable comments posted: 1

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:
a5bea658-f46b-4bc1-9137-9ab481bcef55
Files selected for processing: 2-
skill-guides/orca-cli/references/browser.mdsrc/cli/bundled-skill-guides.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.
-
| - Without `--page`, a command goes to the worktree's current tab. That stays the agent's tab while it has had a command in the last 20 seconds or so, even after the user picks another (`tab current` reports it too), then moves to the user's pick. | ||
| - After `ORCA tab switch`, pass the new page's `browserPageId`. | ||
| - Browser commands default to the current worktree. `--page` reaches the page in any worktree unless you also pass `--worktree <selector>`. Use `--worktree all` only intentionally. | ||
| - `tab create --split <right|left|down|up>` opens the page in a new pane beside the calling terminal instead of as another tab; focus stays in the terminal. |
There was a problem hiding this comment.
Document the unsupported split contexts.
tab create --split is rejected for headless serve, client-hosted pages, and SSH hosts. This rule presents the option as unconditional. Document the supported desktop context and these rejection cases. Regenerate src/cli/bundled-skill-guides.ts after updating this source guide.
`orca tab create` could only add a tab to an existing pane, so an agent had no way to put a page beside its terminal. `--split <right|left|down|up>` creates a new pane next to the calling terminal (ORCA_TAB_ID), falling back to the active pane, and opens the page there without taking focus. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01UNtbMA9iVj9T4rBUjn5u6W
The preload listener, its callback, the preload API contract and main's sender each declared the payload separately, and the listener copy had already drifted from the new split fields. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Creating an empty group and then filling it fails when main owns the layout, because the window's group doesn't exist until main's frame lands. createBrowserTab's split option carries both to whichever owner draws them, so the rollback for a half-made pane goes away. SSH hosts already cannot choose a new tab's group, so their CLI's split is stripped like targetGroupId.
…can't happen A CLI run outside its workspace's directory sends no workspace, so the renderer fell back to the active one and missed the caller's terminal. The caller's tab now picks the workspace when none was named. An SSH host's split and an empty --split= both turned into a plain tab reported as success; both are refused instead.
ddfc4ec to
e045dee
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Do not send worktree with split requests. · browser-tab.ts:75-87
src/cli/handlers/browser-tab.ts:75-87
Minor · Functional Correctness · Quick win Do not send
worktreewith split requests.When
--splitand an explicit--worktreename different from the caller’s workspace are used, the CLI sends bothworktreeandsplitFromTabId. The renderer givesworktreeprecedence, cannot find the caller there, and places the tab in that workspace’s active or root group instead of beside the calling terminal.Suggested fix
const result = await client.call<{ browserPageId: string }>( 'browser.tabCreate', { url, - worktree, profileId, - ...(split ? { split, ...(callerTabId ? { splitFromTabId: callerTabId } : {}) } : {}) + ...(split + ? { split, ...(callerTabId ? { splitFromTabId: callerTabId } : {}) } + : { worktree }) },

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:
9d087234-0555-4d7a-a7e9-f90eaef05ec8
Files selected for processing: 4-
skill-guides/orca-cli/references/browser.mdsrc/cli/browser.test.tssrc/cli/bundled-skill-guides.tssrc/cli/specs/browser-basic.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.
-
Carries over #27370 by @kmizzi.
ELI5
An agent in an Orca terminal can now open a web page in a new pane beside itself, instead of as a hidden tab behind the terminal.
What Changed
Before:
orca tab create --url <url>always added the page as another tab in an existing pane. To get it beside the terminal you had to drag the tab into a split yourself.After:
orca tab create --url <url> --split <right|left|down|up>opens a new pane next to the terminal that ran the command and loads the page there. Keyboard focus and the active pane stay on the terminal. Without--splitnothing changes.How it works (the first two commits are @kmizzi's, rebased onto main; the third is ours):
src/cli/handlers/browser-tab.ts): validates--splitand sendssplitplus the caller'sORCA_TAB_IDassplitFromTabIdonbrowser.tabCreate.browser-tab-creation.ts): forwards them on the existingbrowser:requestTabCreateIPC. Headless serve and client-hosted pages reject--splitwith a clear error instead of quietly making a plain tab.browser-request-ipc-bridge.ts,browser-tab-split-placement.ts): picks the source pane (the group holding the caller's terminal tab, else the active pane, else the root group) and callscreateBrowserTabwith its existingsplitoption, the one link routing and "open to the side" use.desktop-browser-bridge-executor.ts): asplitfrom a host's CLI is refused, because a host can't choose the desktop's layout (itstargetGroupIdis already stripped for the same reason).Why
The UI already opens pages beside a pane (link routing, "open to the side"); the CLI just couldn't ask for it.
Changes from #27370:
createBrowserTab({ split })carries the split and the tab together to whichever side owns the layout, and the rollback goes away.splitfrom one is refused rather than quietly turned into a plain tab.--split=is rejected instead of opening a plain tab.fallbackWorktreeIdto the same IPC payload, and it has been added to the sharedBrowserTabCreateRequesttype.Linked Issue
Fixes #27369
Visual Proof
From a hidden macOS dev build of this branch, each command run inside an Orca terminal. The page area is blank grey because a hidden window doesn't paint web pages; the store and the address bar show example.com loaded. The before shot is from #27370.
orca tab create --url https://example.comorca tab create --url https://example.com --split rightTesting
Manual, macOS dev build, run from inside Orca terminals and checked against the store:
--split right: the layout became a horizontal split with the terminal's pane first and the new browser pane second. The active pane and keyboard focus stayed on the terminal.--split downin a single-pane workspace: a vertical split with the new pane below.--split leftwhile a different pane was active: the split still went beside the terminal that ran the command, and the active pane didn't change.tab create: the layout didn't change and the tab went into an existing pane, as before.--split diagonal: rejected with--split must be right, left, down, or up.Automated:
src/cli/browser.test.tscovers the flag (sent with the caller's tab, left out without the flag, unknown or empty direction rejected).browser-request-ipc-bridge.split.test.tschecks that a split request goes beside the caller's terminal or falls back to the active pane, uses the caller's workspace when none is named, and that a plain create has no split. The SSH bridge test covers refusingsplit.Ran
pnpm tc, oxlint/oxfmt on changed files,verify:bundled-skill-guides,verify:rpc-params-catalogandpnpm check:changed. One unit test failed locally, insrc/main/orcad/electron-serve-browser-process.test.ts, which this PR doesn't touch: its real-home write guard trips on this Mac. Not tested on Linux or Windows; the change has no paths, shortcuts or processes.AI Disclosure
Review
Agent skill upstream boundary
Notes
split.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)