You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(browser): open target=_blank links in Server (streamed) pages as new tabs - #37102
When a remote server workspace is set to Server (streamed), clicking a link that opens in a new tab did nothing. Now it opens a new Orca tab in that workspace, and the person who clicked lands on it.
What Changed
Before: in a streamed page on a headless orca serve host, a target=_blank link click was dropped. Nothing opened and the tab count stayed the same.
After: the link opens as a new browser tab in the page's workspace and profile. Only the client that clicked moves to it, the way a local page brings its new tab to the front. A link no paired client opened opens in the background for everyone, and the agent keeps its current tab. That covers an agent's click, a script, or a middle-click. This applies to desktop and phone alike.
Mechanism:
Streamed pages are offscreen windows on the server with no renderer. openLinkInOrcaTab used to need a renderer, so it returned false and the popup policy denied the link. It now hands an offscreen page's link to a runtime opener (setOffscreenTabOpener), which calls the existing browserTabCreate for the page's workspace. Pages with no workspace (orcad's Electron browser) keep the old behaviour.
Who clicked: the bridge's per-page command queue records each command's RPC caller when it is queued. When activating input reaches the page, BrowserPageInputCredit credits that input to the paired client whose command delivered it. That input is mouse down/up, keys, or a phone's DOM-activated tap. Wheel, move and snapshot commands leave the credit alone, and an agent's command clears it. The credit is single use and lasts 1s, like the existing input-gesture window.
A credited foreground open creates the tab with navigation caller and a new opensPageLink marker. The marker sends navigationIntent: 'follow' to that one client, which desktop and mobile already honour. Any other open is created in the background, and the session tab list is announced right away without moving the agent's routing.
Why
The headless runtime already owns tab creation for these pages (orca tab create uses the same path), so links reuse it instead of adding a second tab model. A server-side open on someone's behalf has no pending focus on the client, so the server has to tell that client to follow. Telling every client to follow would move views nobody asked to move. Earlier versions recorded the click in the input RPC handlers. That missed agent commands with no explicit page and input sent through exec, fill or type, and a watcher's scroll could take credit for an agent's link. Crediting at the guest's real activating input, via the queue's runner, avoids all three.
Linked Issue
#36804. This fixes item 2 only (target=_blank links in Server (streamed) pages). The issue's other items are tracked separately.
Visual Proof
Paired desktop client on a headless orca serve host, Server (streamed) page with a target=_blank link, 4s after a real click on the streamed frame.
Before (main): nothing opens, still on the source page. (screenshot removed: contained real product data)
After: the link opens as a new tab in front for the clicking client. (screenshot removed: contained real product data)
Testing
New e2e tests/e2e/paired-remote-browser-blank-link.spec.ts: a headless serve host plus a paired Electron client. A scripted click opens the tab without moving the client's view, and a real click on the streamed frame brings the new tab to the front. It fails on main ("the server never opened the link as a tab") and passes on this branch (macOS).
Unit tests at the owners: browser-page-input-credit.test.ts, offscreen-browser-page-link.test.ts, the offscreen and no-workspace cases in browser-manager-popup-routing.test.ts, the background announcement in browser-tab-create-publication.test.ts, and the phone tap credit in agent-browser-bridge-mouse-input.test.ts. Each fails without its fix.
Repro before the fix on a hidden headless serve built from this worktree: clicking the link left orca tab list at one tab. After the fix it showed the destination as a second tab.
Focused and dependent suites pass (47 files). Changed-file code-quality gate passes. Full lint, typecheck and suite are left to CI.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Four review rounds (Codex plus Claude). Accepted and fixed:
queued clicks losing their client;
unpaired input not clearing an earlier client's credit;
background opens moving the agent's tab;
orcad Electron pages opening hidden tabs;
agent commands with no explicit page;
background tabs not announced until their first load;
watcher scrolls taking credit;
popup id vs root tab id;
phone DOM taps going uncredited.
Left as P3:
a scripted window.open within 1s of an unrelated click can follow that client, the same window the existing gesture check allows;
a failed create still reports "opened in Orca", which the renderer path also did;
placing the new tab beside its opener in split layouts (follow-up).
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Remote and mixed versions: no wire fields added. navigationIntent: 'follow' already exists, so older clients and the phone honour it. A new client with an older server keeps today's behaviour.
Mobile: phone taps (browser.mouseClick, including the DOM-activated path) get the same foreground behaviour.
Desktop hosts with a window keep the renderer path unchanged. Folder workspaces resolve through id:<workspace>.
Not covered here: "This device" (client-hosted) pages may have a similar target=_blank gap. That is outside item 2.
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)
…tabs
Headless serve pages have no renderer, so a page's new-tab request was
denied. The runtime now opens the link as a tab beside the page, in front
only for the paired client whose click or key press opened it.
A click waiting in the page's command queue keeps its client until it is
delivered, input with no paired client clears an older one, and an
unattributed link no longer moves the agent's tab.
Record the paired client at the bridge's per-page command lease, which
sees the resolved page and every command kind, instead of in four RPC
handlers. A page without a workspace keeps denying new-tab links.
Credit at the guest's activating input, under the popup owner's tab, to
the command delivering it, so a watcher's scroll can't claim an agent's
link. Announce a background tab at once since bridge selection no
longer does.
The queue owns the page command credit instead of the agent lease, the
credit skips work while idle and shares the gesture's freshness rule,
one opener serves both link paths, and one opensPageLink marker replaces
the paired follows/leavesAgentTab flags.
The changes track paired-device input delivered during page commands and use recent input credit when opening links from eligible offscreen browser guests. They add runtime wiring for offscreen tab creation and mark page-link tab publications so they can notify session-tab watchers without activating the bridge tab. Caller navigation now carries follow metadata for these page-link operations.
Merge Risk: Low · up to ade4d
A failed test-host launch can leave the test server running, and the new test would miss a link opening in the wrong browser profile. Both are bounded issues to address or explicitly accept before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely identifies the main change: opening target=_blank links in Server (streamed) pages as new tabs.
Description check
The description includes the required sections, explains the user-facing behavior and implementation, links the issue, provides visual proof, documents testing, and records scope and limitations. The …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description includes the required sections, explains the user-facing behavior and implementation, links the issue, provides visual proof, documents testing, and records scope and limitations. The empty AI Disclosure and Review sections are non-critical.
Full details: Docstring Coverage
Explanation
Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 25 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
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.
The scripted branch proves only that the host created a page and that the source tab stayed selected. It does not prove that the paired client rendered the new background tab. Capture the paired tabId, then assert that its visible tab contains the loaded title Blank destination.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Close the link server when host launch fails.
If launchHeadlessPairedRuntimeHost() rejects, execution never enters the try at Line 48. The link server remains open and can keep the test worker alive. Move host launch inside the guarded lifecycle. Ensure that cleanup still closes the server if client or host disposal fails.
Make the new-tab assertion check profile inheritance from a non-default opener.
The test creates the opener in the default profile. A regression that opens the target=_blank destination in the default profile would still pass. Comparing the opener's and destination's profileId values does not help in that case, because both values would be the default profile. Put the opener in a non-default profile first. Then assert that the destination keeps that profile.
Add the profile setup after the opener is created:
In waitForOpenedTab, assert the destination row's profile after the new ID is found. Read the rows with a helper that keeps profileId. The current readHostBrowserPageIds drops it, so add a sibling helper in tests/e2e/helpers/host-session-tabs.ts that returns { browserPageId, profileId } from the same browser.tabList call:
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
…new tabs (stablyai#37102)
* fix(browser): open target=_blank links from streamed server pages as tabs
Headless serve pages have no renderer, so a page's new-tab request was
denied. The runtime now opens the link as a tab beside the page, in front
only for the paired client whose click or key press opened it.
* test: add the offscreen tab opener to browser manager fakes
* test(e2e): drive the blank-link check through the host client
* fix(browser): credit a link only to the client whose input opened it
A click waiting in the page's command queue keeps its client until it is
delivered, input with no paired client clears an older one, and an
unattributed link no longer moves the agent's tab.
* refactor(browser): credit link opens from the page's command queue
Record the paired client at the bridge's per-page command lease, which
sees the resolved page and every command kind, instead of in four RPC
handlers. A page without a workspace keeps denying new-tab links.
* fix(browser): credit a link to the client whose click reached the page
Credit at the guest's activating input, under the popup owner's tab, to
the command delivering it, so a watcher's scroll can't claim an agent's
link. Announce a background tab at once since bridge selection no
longer does.
* fix(browser): credit a phone's DOM-activated tap before it runs
A tap with a touch radius clicks the element through Runtime.evaluate,
which fires no guest input event, so credit the tapping client first.
* test(e2e): assert the blank-link tab through the page, not the store
* refactor(browser): simplify page-link credit and tab opening
The queue owns the page command credit instead of the agent lease, the
credit skips work while idle and shares the gesture's freshness rule,
one opener serves both link paths, and one opensPageLink marker replaces
the paired follows/leavesAgentTab flags.
* test(e2e): give the blank-link spec's timeout its reason
Nenzyz
pushed a commit
to Nenzyz/orca
that referenced
this pull request
Nov 2, 2026
…new tabs (stablyai#37102)
* fix(browser): open target=_blank links from streamed server pages as tabs
Headless serve pages have no renderer, so a page's new-tab request was
denied. The runtime now opens the link as a tab beside the page, in front
only for the paired client whose click or key press opened it.
* test: add the offscreen tab opener to browser manager fakes
* test(e2e): drive the blank-link check through the host client
* fix(browser): credit a link only to the client whose input opened it
A click waiting in the page's command queue keeps its client until it is
delivered, input with no paired client clears an older one, and an
unattributed link no longer moves the agent's tab.
* refactor(browser): credit link opens from the page's command queue
Record the paired client at the bridge's per-page command lease, which
sees the resolved page and every command kind, instead of in four RPC
handlers. A page without a workspace keeps denying new-tab links.
* fix(browser): credit a link to the client whose click reached the page
Credit at the guest's activating input, under the popup owner's tab, to
the command delivering it, so a watcher's scroll can't claim an agent's
link. Announce a background tab at once since bridge selection no
longer does.
* fix(browser): credit a phone's DOM-activated tap before it runs
A tap with a touch radius clicks the element through Runtime.evaluate,
which fires no guest input event, so credit the tapping client first.
* test(e2e): assert the blank-link tab through the page, not the store
* refactor(browser): simplify page-link credit and tab opening
The queue owns the page command credit instead of the agent lease, the
credit skips work while idle and shares the gesture's freshness rule,
one opener serves both link paths, and one opensPageLink marker replaces
the paired follows/leavesAgentTab flags.
* test(e2e): give the blank-link spec's timeout its reason
Nenzyz
pushed a commit
to Nenzyz/orca
that referenced
this pull request
Nov 2, 2026
…new tabs (stablyai#37102)
* fix(browser): open target=_blank links from streamed server pages as tabs
Headless serve pages have no renderer, so a page's new-tab request was
denied. The runtime now opens the link as a tab beside the page, in front
only for the paired client whose click or key press opened it.
* test: add the offscreen tab opener to browser manager fakes
* test(e2e): drive the blank-link check through the host client
* fix(browser): credit a link only to the client whose input opened it
A click waiting in the page's command queue keeps its client until it is
delivered, input with no paired client clears an older one, and an
unattributed link no longer moves the agent's tab.
* refactor(browser): credit link opens from the page's command queue
Record the paired client at the bridge's per-page command lease, which
sees the resolved page and every command kind, instead of in four RPC
handlers. A page without a workspace keeps denying new-tab links.
* fix(browser): credit a link to the client whose click reached the page
Credit at the guest's activating input, under the popup owner's tab, to
the command delivering it, so a watcher's scroll can't claim an agent's
link. Announce a background tab at once since bridge selection no
longer does.
* fix(browser): credit a phone's DOM-activated tap before it runs
A tap with a touch radius clicks the element through Runtime.evaluate,
which fires no guest input event, so credit the tapping client first.
* test(e2e): assert the blank-link tab through the page, not the store
* refactor(browser): simplify page-link credit and tab opening
The queue owns the page command credit instead of the agent lease, the
credit skips work while idle and shares the gesture's freshness rule,
one opener serves both link paths, and one opensPageLink marker replaces
the paired follows/leavesAgentTab flags.
* test(e2e): give the blank-link spec's timeout its reason
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When a remote server workspace is set to Server (streamed), clicking a link that opens in a new tab did nothing. Now it opens a new Orca tab in that workspace, and the person who clicked lands on it.
What Changed
Before: in a streamed page on a headless
orca servehost, atarget=_blanklink click was dropped. Nothing opened and the tab count stayed the same.After: the link opens as a new browser tab in the page's workspace and profile. Only the client that clicked moves to it, the way a local page brings its new tab to the front. A link no paired client opened opens in the background for everyone, and the agent keeps its current tab. That covers an agent's click, a script, or a middle-click. This applies to desktop and phone alike.
Mechanism:
openLinkInOrcaTabused to need a renderer, so it returned false and the popup policy denied the link. It now hands an offscreen page's link to a runtime opener (setOffscreenTabOpener), which calls the existingbrowserTabCreatefor the page's workspace. Pages with no workspace (orcad's Electron browser) keep the old behaviour.BrowserPageInputCreditcredits that input to the paired client whose command delivered it. That input is mouse down/up, keys, or a phone's DOM-activated tap. Wheel, move and snapshot commands leave the credit alone, and an agent's command clears it. The credit is single use and lasts 1s, like the existing input-gesture window.callerand a newopensPageLinkmarker. The marker sendsnavigationIntent: 'follow'to that one client, which desktop and mobile already honour. Any other open is created in the background, and the session tab list is announced right away without moving the agent's routing.Why
The headless runtime already owns tab creation for these pages (
orca tab createuses the same path), so links reuse it instead of adding a second tab model. A server-side open on someone's behalf has no pending focus on the client, so the server has to tell that client to follow. Telling every client to follow would move views nobody asked to move. Earlier versions recorded the click in the input RPC handlers. That missed agent commands with no explicit page and input sent through exec, fill or type, and a watcher's scroll could take credit for an agent's link. Crediting at the guest's real activating input, via the queue's runner, avoids all three.Linked Issue
#36804. This fixes item 2 only (
target=_blanklinks in Server (streamed) pages). The issue's other items are tracked separately.Visual Proof
Paired desktop client on a headless
orca servehost, Server (streamed) page with atarget=_blanklink, 4s after a real click on the streamed frame.Before (main): nothing opens, still on the source page.
(screenshot removed: contained real product data)
After: the link opens as a new tab in front for the clicking client.
(screenshot removed: contained real product data)
Testing
New e2e
tests/e2e/paired-remote-browser-blank-link.spec.ts: a headless serve host plus a paired Electron client. A scripted click opens the tab without moving the client's view, and a real click on the streamed frame brings the new tab to the front. It fails on main ("the server never opened the link as a tab") and passes on this branch (macOS).Unit tests at the owners:
browser-page-input-credit.test.ts,offscreen-browser-page-link.test.ts, the offscreen and no-workspace cases inbrowser-manager-popup-routing.test.ts, the background announcement inbrowser-tab-create-publication.test.ts, and the phone tap credit inagent-browser-bridge-mouse-input.test.ts. Each fails without its fix.Repro before the fix on a hidden headless serve built from this worktree: clicking the link left
orca tab listat one tab. After the fix it showed the destination as a second tab.Focused and dependent suites pass (47 files). Changed-file code-quality gate passes. Full lint, typecheck and suite are left to CI.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Four review rounds (Codex plus Claude). Accepted and fixed:
Left as P3:
window.openwithin 1s of an unrelated click can follow that client, the same window the existing gesture check allows;Agent skill upstream boundary
Notes
navigationIntent: 'follow'already exists, so older clients and the phone honour it. A new client with an older server keeps today's behaviour.browser.mouseClick, including the DOM-activated path) get the same foreground behaviour.id:<workspace>.target=_blankgap. That is outside item 2.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)