Skip to content

feat(browser): option to route agent browser work to the Orca browser - #28180

Open
seogineer wants to merge 8 commits into
stablyai:mainfrom
seogineer:feat/orca-browser-for-agent-work
Open

seogineer wants to merge 8 commits into
stablyai:mainfrom
seogineer:feat/orca-browser-for-agent-work

Conversation

@seogineer

@seogineer seogineer commented Oct 13, 2026 •

Copy link
Copy Markdown

ELI5

A new switch in Settings → Browser keeps browser work inside Orca.

When it is on:

  • A tool in an Orca terminal that wants to open a web page opens it in an Orca browser tab instead of Chrome or Safari.
  • Claude and Codex, when Orca launches them, are told to use Orca's browser for their own browser work.

What Changed

Before, three things happened outside Orca:

  • Terminal tools opened BROWSER links in the system browser. Examples are Claude sign-in, gh auth login, and Python webbrowser.
  • Agents used Playwright, Chrome MCP, or a headless browser for previews and UI checks.
  • The existing "Link Routing" setting only covered links clicked inside Orca's own UI, so it did not change either of the above.

After, a new setting Use Orca Browser for Agent Work (useOrcaBrowserForAgentWork) is available. It is off by default. When it is on, the following applies.

1. BROWSER is forced in new local terminals.

  • New local terminals get BROWSER="orca tab create --activate --url %s". This value replaces any inherited BROWSER.
    • WSL terminals use orca-ide instead of orca.
    • A headless orca serve keeps its existing open-url relay.
  • The logic lives in the new host-env/terminal-browser-env.ts.
  • The Codex remote-viewer clipboard env still depends only on the headless flag, so turning this setting on does not change it.
  • orca tab create gains an --activate flag. The RPC param already existed, so there is no wire change.
  • I used tab create instead of open-url because open-url fails on a desktop app. It needs a paired client host lease and a required worktree.

2. Claude and Codex get an advisory instruction at launch.

  • Claude gets --append-system-prompt <guidance>.
  • Codex gets -c developer_instructions='<guidance>'.
  • Where it is added: inside resolveAgentLaunchCommand, so every Orca-built launch path picks it up. Main-side paths read the setting through resolveAgentStartupPlanInputs. Renderer paths pass it explicitly.
  • Where it is not added:
    • It is kept out of commandWithoutSessionOptions. So it is never saved into resume or sleeping-session configs, and each launch re-derives it from the current setting.
    • It is skipped for SSH launches.
    • It is skipped when the user's args or the command override already set the same option.
  • Codex never masks the user's own instructions. The decision is made at spawn time, on the host that runs the terminal, from the values that launch will actually use:
    • The builders add the Codex instruction only for launches that go through this app's own spawn pipelines (codexGuidanceSpawnGated).
    • Both spawn pipelines (the renderer IPC spawn and the runtime spawn used by CLI, mobile and host-built launches) call gateCodexBrowserGuidance right before the PTY starts. It checks the real launch directory, the WSL runtime, the SSH connection and the selected Codex home.
    • It reads the system config (/etc/codex/config.toml outside Windows), ~/.codex and $CODEX_HOME, the selected account home, and every .codex/config.toml from the real launch directory up to the filesystem root.
    • If the instruction must not be added, it is removed from the command. For a launch that waits for a worktree setup script, it is also removed from the sequenced startup env. If removal cannot be proven, the sequenced launch refuses to start rather than mask the user's instructions.
    • There is no cache, so a config edit applies from the very next launch.
  • The instruction is removed (or never added) in each of these cases:
    • Any config layer sets a top-level developer_instructions.
    • Any config layer sets profile. A profile can be selected in one layer and defined in another, so Orca does not try to resolve which profile is active.
    • A -p or --profile flag, or the user's own -c developer_instructions, is present.
    • A config file cannot be read or parsed.
    • The launch directory is unknown.
    • The launch runs in WSL (WSL runtime or \\wsl$ path), over SSH, or on a paired Orca server or web client. Those hosts read a config this host cannot see, and an older paired server has no spawn gate.
  • The guidance text is one ASCII line with no shell metacharacters. A test enforces this, so the same text quotes safely in posix, PowerShell and cmd.

Why

  • Why BROWSER instead of intercepting xdg-open or open: BROWSER is the standard, cross-platform hook that Orca already uses for the headless relay. Shims for xdg-open and open would need per-platform PATH management. They are left as a follow-up.
  • Why a launch-time instruction instead of a hard block: there is no portable way to forbid an agent from using Playwright. A launch flag works through each agent's own supported channel and needs no file edits in the user's agent config.
  • Why one shared function: putting the instruction in resolveAgentLaunchCommand avoids touching each launch path separately and keeps it out of persisted resume state.
  • Not covered (follow-ups): OpenCode and other agents, native chat and structured sessions, syncing the setting to remote hosts.

Linked Issue

Fixes #28177

Visual Proof

Captured from an e2e build of this branch on Linux. The app ran on an isolated Xvfb display (ORCA_BACKGROUND_LAUNCH=1, electron-headful).

Settings → Browser: the new row, off (default) and on

Off (default) On
off on

After turning it on, a newly split terminal pane gets the forced BROWSER

terminal BROWSER env

The existing Agent Browser Use row at the top of the same pane is a setup checklist: it installs the orca-cli skill and imports cookies. It makes the Orca browser available to agents but does not route anything to it. This setting is the part that routes work there, so the two complement each other.

Testing

  • pnpm tc passes.

  • check-changed-code-quality passes with 0 new findings, including the design-system check.

  • oxlint on the changed files is clean.

  • generate-bundled-skill-guides --check passes.

  • The localization verify scripts pass.

  • vitest on the new and affected tests passes. The tests cover:

    • BROWSER override, WSL orca-ide, the headless relay, and off-by-default.
    • Exact quoting in posix, PowerShell and cmd, placement before --, and removing the Codex instruction again in each shell without touching the user's own -c args.
    • Dedupe against user args and the command override.
    • The instruction never reaching launchConfig or resume commands.
    • The spawn gate: blocking config in the launch directory or a parent, each home layer, profiles, unreadable and unparsable files, WSL, SSH, and an unknown directory.
    • Setup-script launches in posix (plain, env-prefixed, chained) and Windows: the stripped startup script must equal one built without the instruction.
    • Both spawn pipelines calling the gate.
    • The CLI --activate flag, the settings row and search catalog.
  • I did not run the full suite: pnpm test needs bun, which is not installed here, so I ran vitest directly. In the broader run, every failure also fails the same way on main (agent-session store and replay tests, run-terminal-shell-alone.node-pty, local-base-branch-fast-forward-real-git, and the session-history settings tests).

  • Platform: Linux, unit-level only. I did not do a manual run with the real Claude or Codex binaries.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented with Claude Code (Claude Opus 5.5) and reviewed by me.

Review

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

  • Cross-platform: the BROWSER value and the instruction quoting are covered for posix, PowerShell and cmd. WSL uses orca-ide.
  • SSH: the instruction is skipped for SSH launches. The BROWSER change applies only to local PTYs. Headless or remote hosts keep their existing relay.
  • Backwards compatibility: the setting is a new optional field and defaults to off. --activate maps to an RPC param that already existed.
  • Known limits:
    • A shell rc that exports BROWSER overrides the forced value.
    • Codex users who set any profile never get the instruction. This is on purpose, to stay safe.
    • Codex launches in WSL, over SSH, or on a paired server never get the instruction.
    • Codex launches from the quick composer, folder-workspace submit, onboarding and direct work-item launch do not get the instruction yet. Claude still does.

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)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 49f5ed06-364b-4712-a0ac-afe829203c63
📥 Commits

Reviewing files that changed from the base of the PR and between 18f7ac8b0375bacd95793976141141c6979c1e20 and a2fcd82.

📒 Files selected for processing: 15
  • docs/site/content/docs/cli/reference.mdx
  • src/cli/bundled-skill-guides.ts
  • src/main/ipc/pty-launch-parity.test.ts
  • src/main/ipc/pty/ipc/spawn-run.ts
  • src/main/runtime/orca-runtime-create-agent-session.ts
  • src/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.ts
  • src/main/runtime/runtime-agent-terminal-startup.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
🚧 Files skipped from review as they are similar to previous changes: 7
  • docs/site/content/docs/cli/reference.mdx
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json

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

Adds an opt-in Browser setting for routing local terminal links through Orca and adding browser guidance to agent launches. Claude and Codex launch commands receive guidance under defined conditions; Codex guidance is checked against configuration and launch context before spawn. The change also adds --activate support to CLI tab creation and updates localized setting text, search entries, and tests.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to a2fcd

The inspected local launch paths honor existing Codex instructions before starting a new agent. No merge-blocking issue remains from the reviewed changes.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Issue [#28177] requires Orca-launched Claude and Codex sessions to receive the advisory Orca-browser instruction when the setting is enabled, unless the user supplied equivalent configuration. The PR … Add Codex guidance to the remaining Orca launch paths, or obtain an issue-approved scope change that excludes those paths. Preserve the existing checks for user-provided instructions, profiles, unsafe configuration, SSH, WSL, and remote hos…
Docstring Coverage Warning Docstring coverage is 24.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 61 files. (7 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding an option to route agent browser work to the Orca browser.
Description check Passed The description is comprehensive and covers the required sections, user-facing behavior, implementation details, rationale, linked issue, visual proof, testing, AI disclosure, platform considerations,…
Out of Scope Changes check Passed The changes stay within issue [#28177]. The settings row, localization, search metadata, terminal BROWSER handling, orca tab create --activate, Claude and Codex launch guidance, Codex safety gate,…
Full details: Linked Issues check

Explanation

Issue [#28177] requires Orca-launched Claude and Codex sessions to receive the advisory Orca-browser instruction when the setting is enabled, unless the user supplied equivalent configuration. The PR implements the opt-in setting, local BROWSER routing, Claude guidance, Codex configuration checks, and launch-time stripping safeguards. However, Codex guidance is added only when codexGuidanceSpawnGated is true. The quick composer, folder-workspace submit, onboarding, and direct work-item paths call orcaBrowserGuidanceLaunchOptions without a worktree ID, so Codex receives no guidance in those paths. The current PR description also records this limitation.

Resolution

Add Codex guidance to the remaining Orca launch paths, or obtain an issue-approved scope change that excludes those paths. Preserve the existing checks for user-provided instructions, profiles, unsafe configuration, SSH, WSL, and remote hosts. Add path-specific tests that verify the instruction reaches each supported local Codex launch.

Full details: Docstring Coverage

Explanation

Docstring coverage is 24.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 61 files. (7 skipped: 7 unsupported.)

  • 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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3003ed12-b43d-4419-8d98-1b1fdb8f2b6c
📥 Commits

Reviewing files that changed from the base of the PR and between ef890ae and 4f1c0f4f02bd601bd05bcc5ec95ea481e2074da1.

📒 Files selected for processing (58)
  • docs/site/content/docs/cli/reference.mdx
  • skill-guides/orca-cli/references/browser.md
  • src/cli/browser.test.ts
  • src/cli/bundled-skill-guides.ts
  • src/cli/handlers/browser-tab.ts
  • src/cli/specs/browser-basic.ts
  • src/main/codex/codex-user-developer-instructions.test.ts
  • src/main/codex/codex-user-developer-instructions.ts
  • src/main/ipc/codex-config-sync.ts
  • src/main/ipc/pty-spawn-env-terminal-basics.test.ts
  • src/main/ipc/pty/host-env/assembly.ts
  • src/main/ipc/pty/host-env/terminal-browser-env.ts
  • src/main/ipc/pty/host-env/types.ts
  • src/main/ipc/pty/ipc/spawn-env-codex.ts
  • src/main/ipc/pty/provider/local-configure.ts
  • src/main/ipc/pty/runtime/spawn-preflight.ts
  • src/main/runtime/orca-runtime-create-agent-session.ts
  • src/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.ts
  • src/main/runtime/runtime-agent-terminal-startup.ts
  • src/main/runtime/runtime-worktree-agent-startup.ts
  • src/preload/api/agent-account-api.ts
  • src/preload/api/codex-config-sync-bridge.ts
  • src/renderer/src/components/settings/BrowserAgentWorkSetting.test.tsx
  • src/renderer/src/components/settings/BrowserAgentWorkSetting.tsx
  • src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-agent-work-search.ts
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/components/sidebar/folder-workspace-agent-startup.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts
  • src/renderer/src/hooks/composer-state/quick-startup-plan.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/launch-agent-background-session.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-work-item-direct-agent.ts
  • src/renderer/src/lib/onboarding-folder-agent-startup.ts
  • src/renderer/src/lib/orca-browser-guidance-launch-options.test.ts
  • src/renderer/src/lib/orca-browser-guidance-launch-options.ts
  • src/renderer/src/store/slices/settings.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-browser-guidance.test.ts
  • src/shared/agent-browser-guidance.ts
  • src/shared/agent-session-option-agent-args.ts
  • src/shared/agent-startup-plan-inputs.test.ts
  • src/shared/agent-startup-plan-inputs.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/telemetry-property-schemas.ts
  • src/shared/tui-agent-launch-command-browser-guidance.test.ts
  • src/shared/tui-agent-launch-command.ts
  • src/shared/tui-agent-startup-browser-guidance.test.ts
  • src/shared/tui-agent-startup.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.

@seogineer
seogineer force-pushed the feat/orca-browser-for-agent-work branch from 71c0afb to 735a49d Compare October 14, 2026 00:59

@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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be38e79c-271b-4d80-a9f3-60a527f7078f
📥 Commits

Reviewing files that changed from the base of the PR and between 71c0afb33c9e3caf0ab8e806645580ff708de8d2 and 735a49d6b92e70af8068c150def152ba8f2d5232.

📒 Files selected for processing: 19
  • src/main/ipc/pty-spawn-env-terminal-basics.test.ts
  • src/main/ipc/pty/runtime/spawn-preflight.ts
  • src/main/runtime/orca-runtime-activate-managed-worktree.ts
  • src/main/runtime/orca-runtime-create-agent-session.ts
  • src/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.ts
  • src/main/runtime/orca-runtime-terminal-create-deduplication.ts
  • src/main/runtime/runtime-agent-terminal-startup.ts
  • src/main/runtime/runtime-worktree-agent-startup.test.ts
  • src/main/runtime/runtime-worktree-agent-startup.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/launch-agent-background-session.ts
  • src/shared/agent-startup-plan-inputs.test.ts
  • src/shared/agent-startup-plan-inputs.ts
  • src/shared/default-global-settings.ts
🚧 Files skipped from review as they are similar to previous changes: 6
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/ja.json

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

서도경 and others added 8 commits October 15, 2026 10:25
…wser

Adds a "Use Orca Browser for Agent Work" setting (off by default). When on:
- new local terminals force BROWSER to `orca tab create --activate --url %s`
  (orca-ide on WSL, open-url under a headless relay), overriding any inherited value;
- Orca-built Claude and Codex launches get an advisory instruction to do browser
  work through the Orca browser CLI. Codex is skipped when the user's own config
  (or active profile) already defines developer_instructions.

Also adds `--activate` to `orca tab create`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g Orca browser guidance

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without a cwd the project .codex/config.toml cannot be checked, and the -c
override would mask it. Drops the cwd-less cache primes that no launch reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h directory and runtime

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…late tests from real Codex config

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
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.

Option to route agent browser work to the Orca browser

1 participant