Skip to content

fix(web): the paired server is the web client's only host - #27266

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/d4-d4-v6
Oct 10, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/d4-d4-v6

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​202 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​202
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​187 $\color{#cf222e}{\Huge{\mathbf{−}}}$​68 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​119

ELI5

The web client is Orca running in a browser tab, connected to one paired Orca server. A browser tab has no terminals, files, browser window or macOS window buttons of its own: everything lives on that server. Several places still treated the browser tab as if it were a computer that could run things, so they quietly did nothing or failed. Now the web client treats its paired server as its only host.

What Changed

Before and after, in the web client:

  • Terminals and agents on the server's own projects. Before: when a workspace, the active-workspace selection, or a setup terminal (skill installs, feature tips) named the server's own machine as local, Orca read that as "this browser" and failed with "Local PTYs are unavailable in the web client" or "Couldn't determine which host owns this workspace". After: they start on the paired server.
  • Agent Dashboard pop-out. Before: with "Open as: Pop-out", clicking Agent Dashboard did nothing, because a browser tab cannot open a second Orca window. After: the web client always opens the in-window board, and the "Open as" choice is hidden there.
  • Open in Orca Browser on a file. Before: nothing happened and an uncaught error went to the console, because the document preview is a desktop-only embedded view. After: the action is hidden in the web client, and the address-bar path that would open a document shows "Document previews aren't available in the web client."
  • macOS titlebar gap. Before: on a Mac browser, the web client reserved an empty 80px gap for the window buttons a desktop window has. After: no gap; the desktop app is unchanged.

Mechanism:

  • paired-web-client-host.ts (new): in a paired web client with exactly one saved server, an owner route that has no server (local, or an SSH target with no server named) is sent through that server. local becomes runtime:<server>; an SSH target keeps its name and gains the server as transport. The never-routable sentinel host stays refused.
  • It is applied at the shared owner resolvers every caller already goes through: resolveWorktreeOperationRouteResult and the selected-host route (worktree-operation-route.ts), getRuntimeEnvironmentIdForWorktree, the folder-workspace owner, and the single-server fallback used by setup terminals. An id that two hosts publish is still refused, not guessed.
  • agent-dashboard-open-mode.ts (new) gives the effective open mode; the sidebar entry, the shortcut, the board's settings menu and the Experimental setting read it.
  • doc-preview-web-client.ts (new) refuses the document preview plan in the web client; canShowWorkspaceFileBrowserAction already hides an action whose plan is refused.
  • app-window-chrome.ts exports hasMacTrafficLights (macOS and not the web client); the titlebar pad and --mac-traffic-lights-width use it.

Why

The design for this slice is "the paired server is the web client's only host". Rows the server sends are already stamped with the server as owner, so most workspaces already worked. What remained were the paths that fell back to local: a restored active-workspace selection, rows that predate stamping, folder workspaces and setup terminals. Fixing it once in the shared resolvers covers every caller (terminals, file explorer, paste and drop, background launches) instead of patching each symptom.

Alternatives considered:

  • Making the web client's "Active Server" setting always equal the paired server. Rejected: the design removes routing by that setting, and it would not cover rows that explicitly name local.
  • Rendering document previews in the browser. Not possible with the current preview, which is a desktop embedded view backed by grants the desktop mints; it would need a server-served preview. This PR stops the silent failure; it does not add that feature.

Desktop behavior is unchanged: every new branch is gated on the web client flag.

Linked Issue

Fixes #9047
Fixes #22618
Fixes #19299

Also completes the pop-out half of #22218 (already closed; its preview half landed in #27250).

Visual Proof

N/A for screenshots from this machine (no local Electron or web runs are allowed here). The titlebar change removes an 80px empty pad at the top-left of the web client on macOS browsers; the dashboard change replaces a dead click with the in-window board; the file action is no longer offered in the web client. Each is covered by a test below.

Testing

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

New tests, each failing on origin/main (7 failures) and passing here:

  • paired-web-client-host.test.ts: in a web client, a workspace whose selection or row says local, a setup terminal, and a local folder workspace all route to the paired server; an SSH target keeps its place with the server as transport; an id two hosts publish is still refused; a desktop window still routes local to this computer.
  • agent-dashboard-open-mode.test.ts: pop-out on desktop, in-window board in the web client.
  • app-window-chrome.test.ts: the inset is reserved on macOS desktop and not in a web client on a Mac browser.
  • file-preview.test.ts: in the web client the action is hidden, opening returns a reason, and the address-bar conversion shows a toast instead of throwing.

Also ran: all renderer tests that touch the web client flag or the dashboard (53 files), src/renderer/src/lib, right-sidebar, terminal-pane and web suites; pnpm tc; oxlint; pnpm run check:code-quality:changed; owner-routing ratchet (unchanged at 223).

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

  • SSH: an SSH target owned by the paired server keeps its host id; only the transport is filled in. Direct SSH from a browser tab never existed.
  • Mixed versions: no RPC, stream or published-content change. Old servers see the same requests they already get for stamped rows.
  • Folder workspaces: covered (local folder workspace on the server routes to the server).
  • Windows/Linux/macOS: the titlebar change only affects macOS browsers in the web client; desktop chrome is unchanged.
  • Performance: one flag check and a length-1 lookup on the owner resolvers.

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)

m4air and others added 2 commits October 10, 2026 08:24
A paired web client is a browser tab with no PTYs, files, browser or
second window of its own, yet owners it read as "local" still routed to
it: setup terminals and server-local rows hit the local PTY stub, the
dashboard pop-out was a silent no-op, Open in Orca Browser threw an
uncaught error, and the macOS traffic-light inset was reserved.

Route a transport-less owner through the paired server at the shared
owner resolvers, open the in-window dashboard, refuse document previews
with a reason, and reserve no traffic-light inset in the web client.

Co-Authored-By: Claude <[email protected]>
@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 10, 2026 15:25
@coderabbitai

coderabbitai Bot commented Oct 10, 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: 22142299-f66a-4f82-9359-96b7f8555113

📥 Commits

Reviewing files that changed from the base of the PR and between ba1474f and 5c50c0d.


📒 Files selected for processing (19)
  • src/renderer/src/app-shell/TitlebarLeftControls.tsx
  • src/renderer/src/app-shell/app-window-chrome.test.ts
  • src/renderer/src/app-shell/app-window-chrome.ts
  • src/renderer/src/components/dashboard/AgentDashboardSettingsMenu.tsx
  • src/renderer/src/components/dashboard/agent-dashboard-open-mode.test.ts
  • src/renderer/src/components/dashboard/agent-dashboard-open-mode.ts
  • src/renderer/src/components/settings/AgentDashboardExperimentalSetting.tsx
  • src/renderer/src/components/sidebar/AgentDashboardSidebarEntry.tsx
  • src/renderer/src/hooks/ipc-events/agent-dashboard-command.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/doc-preview-web-client.ts
  • src/renderer/src/lib/file-preview.test.ts
  • src/renderer/src/lib/file-preview.ts
  • src/renderer/src/lib/folder-workspace-runtime-owner.ts
  • src/renderer/src/lib/paired-web-client-host.test.ts
  • src/renderer/src/lib/paired-web-client-host.ts
  • src/renderer/src/lib/single-runtime-legacy-owner.ts
  • src/renderer/src/lib/worktree-operation-route.ts
  • src/renderer/src/lib/worktree-runtime-owner.ts

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



📝 Walkthrough

Walkthrough

Paired web clients now use their runtime environment when resolving workspace ownership and operation routes. Agent Dashboard mode resolution keeps pop-out controls and actions unavailable in paired web clients. Document-preview actions return an unsupported refusal in paired web clients. macOS traffic-light spacing now excludes paired web clients.


Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 5c50c

No identified issue currently blocks merging.

Pre-merge checks | Passed 2 | Failed 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check Warning #9047 is addressed: the new paired-web-client host helper routes local or ownerless routes through the single paired server, preserves SSH identity, rejects ambiguous ownership, and keeps desktop loca… Implement the document-preview behavior required by #22618 for paired web clients, including the expected preview tab rendering path and automated coverage. Do not treat hiding the action and reporting unavailability as completion of that i…
Out of Scope Changes check Warning The Agent Dashboard pop-out changes are unrelated to the active linked issues #9047, #22618, and #19299. They change dashboard mode resolution, settings controls, sidebar behavior, shortcut behavior, … Remove the Agent Dashboard pop-out changes and their tests from this PR, or provide an active directly linked coding requirement that requires them.
Docstring Coverage Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 18 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: treating the paired server as the web client's only host. It is concise and relevant to the changeset.
Description check Passed The description follows the required template and explains the user impact, implementation, rationale, linked issues, testing, visual proof, compatibility considerations, and checklist status. It also…

Full details: Linked Issues check

Explanation

#9047 is addressed: the new paired-web-client host helper routes local or ownerless routes through the single paired server, preserves SSH identity, rejects ambiguous ownership, and keeps desktop local routing. #19299 is addressed: hasMacTrafficLights excludes paired web clients and has dedicated tests. #22618 is not met: the issue expects “Open in Orca Browser” to open and render a client-side document-preview tab, but webClientDocPreviewRefusal() hides the action and returns an unsupported refusal in the web client. The PR description confirms that it does not add document previews.

Resolution

Implement the document-preview behavior required by #22618 for paired web clients, including the expected preview tab rendering path and automated coverage. Do not treat hiding the action and reporting unavailability as completion of that issue.


Full details: Out of Scope Changes check

Explanation

The Agent Dashboard pop-out changes are unrelated to the active linked issues #9047, #22618, and #19299. They change dashboard mode resolution, settings controls, sidebar behavior, shortcut behavior, and add dashboard tests. The PR identifies these changes as completing the pop-out half of closed issue #22218. Closed issues provide background only and do not establish active scope for this PR.


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. Analyzed 21 functions across 18 files. (1 skipped: 1 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant