Skip to content

fix(browser): "Server (streamed)" on a server that cannot stream hosts pages through it - #35381

Merged
nwparker merged 1 commit into
mainfrom
fix/35156-streamed-tab-inventory
Oct 28, 2026
Merged

nwparker merged 1 commit into
mainfrom
fix/35156-streamed-tab-inventory

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​91 $\color{#cf222e}{\Huge{\mathbf{−}}}$​38 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3

ELI5

If you choose "Server (streamed)" but the server you're paired with can't stream pages, Orca used to open a plain desktop tab that the server didn't know about. Now Orca renders the page on this desktop as a page the server owns. The server can see it, and its traffic still goes through the server.

What Changed

  • Before: with Remote server workspaces = Server (streamed), a desktop paired with an orcad orca serve (whose browser engine has no screencast) handled a new browser tab like this:
    • The desktop opened a plain local tab the server never registered.
    • That tab browsed from the desktop's network, which contradicts the setting's own description: "Traffic always goes through the remote server."
    • The tab never showed up in orca tab list on the server, so an agent couldn't snapshot or drive the page the user was looking at.
  • After: the setting is treated as a rendering preference that only a server able to stream can honor. When the server can't stream, the page goes through the existing client-hosted path, so the desktop renders it as a server-owned page:
    • The page is listed by orca tab list.
    • Agents can drive it with the existing client automation.
    • Its traffic goes through the server's tunnel.
  • Unchanged:
    • Servers that can stream (Electron serve with a window or an offscreen backend) still render on the server.
    • An explicit server placement (reopen on server, links from a streamed pane) is still honored.
  • Mechanism:
    • expectsBrowserClientHosting is the one predicate that both the renderer's staging prediction and main's placement preparation use. It now only lets the setting choose server rendering when the runtime advertises browser.screencast.v1.
    • Main's placement preparation no longer skips the status probe when the setting is off. Only an explicit server preference still skips it.

Why

The two sides of the inventory weren't diverging because of tab sync. The desktop's tab was never a server tab in the first place: the server-render preference had no streaming server to satisfy it, and the fallback was an unregistered local tab. I fixed the shared placement predicate so the renderer and main keep agreeing. I didn't add a special case at the tab-opening call site.

Not covered here, which is why this says Refs: tabs created on the server with orca tab create while the server has its own browser engine are still headless engine pages. A desktop can only show them if orcad's engines can stream, and they can't today. Making orcad stream, or sending server CLI tabs to a paired desktop by default, is a separate design decision.

Linked Issue

Refs #35156

Thanks to NicolasHoferer for the detailed report and the follow-up narrowing it to browser tabs.

Visual Proof

N/A: no new UI. The change is which existing tab kind gets created. Before, it was an unregistered desktop tab; now it is a client-hosted server page, which looks the same in the tab strip.

Testing

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

New tests, each of which fails on origin/main:

  • the shared predicate hosts on this device when the server-render setting meets a server that can't stream;
  • main placement preparation returns a client placement in that case, and still returns server placement when the server can stream;
  • the renderer policy (runtimeHostsPagesOnThisDesktop) and openWorkspaceBrowserTab route the tab through the runtime instead of creating a local tab.

I updated the tests that encoded the old behaviour: "refuse when desktop hosting is disabled" against a server that can't stream, and the main handler fixture, which had a renderer window but no screencast.

pnpm check:changed --maxWorkers=2 passes (27 checks). I did not test against a live paired orcad server.

Review

Codex review: clean. Independent review: no P0–P2. It confirmed the renderer and main stay in agreement, because a mismatch is restaged from main's live placement answer. It also confirmed that mobile, the paired web client, managed SSH deployments (they return early to the SSH browser route), WSL and older servers that lack the client-hosting capabilities are unchanged.

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

  • Mixed versions: only the desktop changed, and there is no new wire field. Older servers that don't advertise the client-hosting capabilities keep the old behaviour.
  • Platforms: no platform-specific code.
  • SSH: managed SSH deployments are unaffected.
  • Mobile: the mobile device scope is still excluded.

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)

…s pages through it

With "Remote server workspaces" set to "Server (streamed)", a paired server
that has no way to stream pages (an orcad `orca serve`: its browser engine
offers no screencast) could not take the desktop's new tabs. The desktop
fell back to a plain desktop tab the server never heard of: it browsed from
the desktop's network and never appeared in `orca tab list`, so agents could
not see or drive the page the user was on.

The setting is a rendering preference. When the server cannot stream, the
desktop now renders the page itself as a page the server owns (the existing
client-hosted path), so traffic still goes through the server and the tab is
listed and drivable from the server's CLI. Servers that can stream keep
rendering on the server; an explicit server placement is unchanged.

Refs #35156
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

When a paired server cannot stream pages, choosing “Server (streamed)” now uses desktop rendering while keeping the page owned by the server.

  • Browser pages stay server-owned when desktops render them for non-streaming servers.

Acknowledgments from nwparker:

  • Desktop rendering despite the server-render setting is intentional when the server cannot stream.
  • Pages created directly through orca tab create remain outside this fix; making those pages visible on a desktop is deferred.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[New browser page] --> B{Explicit server placement?}
  B -->|Yes| S[Server placement]
  B -->|No| C[Read live server status]
  C --> D{Required hosting capabilities and non-mobile device?}
  D -->|No| S
  D -->|Yes| E{Desktop rendering selected or server cannot stream?}
  E -->|No| S
  E -->|Yes| F[Desktop renders a server-owned page]
  F --> G[Restage from main's placement answer]
  S --> G
Loading

Reviews (1) · Last reviewed commit: "fix(browser): "Server (streamed)" on a s..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

Browser client hosting eligibility now accounts for whether a runtime supports screencast. When hosting is disabled, placement checks still run unless the preference explicitly requests server placement. Tests cover streaming and non-streaming runtimes, server placement, and opening eligible runtime routes.

Priority: Normal

Merge Risk: Low · up to da0a2

Opening a new server-rendered tab from an unavailable stream can create another unusable page. This narrow case is mergeable with owner awareness.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the change, rationale, testing, scope, and checklist. However, the required Linked Issue section uses Refs #35156, which the repository template explicitly say… Replace Refs #35156 with a valid linked issue reference that satisfies the template, such as Fixes #35156 or the repository's required issue-link format. Also document whether pnpm lint, pnpm typecheck, pnpm test, and pnpm build…
Docstring Coverage Warning Docstring coverage is 33.33% 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 Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the browser behavior change for servers that cannot stream pages.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, scope, and checklist. However, the required Linked Issue section uses Refs #35156, which the repository template explicitly says is insufficient.

Resolution

Replace Refs #35156 with a valid linked issue reference that satisfies the template, such as Fixes #35156 or the repository's required issue-link format. Also document whether pnpm lint, pnpm typecheck, pnpm test, and pnpm build passed or are covered by CI.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% 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 3 functions across 7 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 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.

❤️ 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
  • 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: 9cc6bc41-d248-414e-a9b1-f18b3929a8bb
Commits

Reviewing files that changed from the base of the PR and between f80a3cc and da0a2b7.

Files selected for processing: 7
  • src/main/browser/browser-client-host-placement-preparation.test.ts
  • src/main/browser/browser-client-host-placement-preparation.ts
  • src/main/ipc/runtime-environments/runtime-environment-browser-client-host-handler.test.ts
  • src/renderer/src/lib/client-creation-action-policy.test.ts
  • src/renderer/src/lib/workspace-browser-tab-open.test.ts
  • src/shared/browser-client-hosting-eligibility.test.ts
  • src/shared/browser-client-hosting-eligibility.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.

Comment on lines +35 to +38
// Why: a server that cannot stream can't honor the server-render setting; its pages would become unregistered desktop tabs.
const serverCanStream = input.capabilities?.includes(BROWSER_SCREENCAST_RUNTIME_CAPABILITY)
return (
input.enabled &&
(input.enabled || !serverCanStream) &&

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.

Minor · Stability & Availability · Quick win

Supported by static analysis

Script executed:

sed -n '300,390p' src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsx
rg -n 'RemoteBrowserPagePane|remote-browser-page-pane|placementPreference: .server.' src/renderer/src

Repository: stablyai/orca

Length of output: 6642


Script executed:

set -o pipefail
printf '%s\n' '--- browser-workspace-pane imports and mounting block ---'
sed -n '1,220p' src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.tsx
printf '%s\n' '--- remote pane declaration and capability/page inputs ---'
sed -n '1,150p' src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsx
printf '%s\n' '--- relevant remote page and runtime capability references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'screencast' -e 'BROWSER_SCREENCAST_RUNTIME_CAPABILITY' -e 'remotePageId' -e 'kind: .remote' src/renderer/src/components/browser-pane src/renderer/src/runtime src/renderer/src/lib | head -240
printf '%s\n' '--- existing server reopen flow ---'
sed -n '1,180p' src/renderer/src/components/browser-pane/browser-reopen-on-server.ts

Repository: stablyai/orca

Length of output: 41423


Script executed:

set -o pipefail
printf '%s\n' '--- screencast capability branch ---'
sed -n '200,245p' src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-lifecycle.ts
printf '%s\n' '--- client-hosted handle predicate ---'
rg -n -F -- 'isClientHostedBrowserPageHandle' src/renderer/src/store src/renderer/src
printf '%s\n' '--- handle type and placement definitions ---'
rg -n -F -- 'type RemoteBrowserPageHandle' src/renderer/src src/shared
rg -n -F -- 'placement:' src/renderer/src/store src/renderer/src/runtime src/shared | head -120

Repository: stablyai/orca

Length of output: 16880


Script executed:

set -o pipefail
printf '%s\n' '--- lifecycle start/open and unsupported-error handling ---'
sed -n '1,210p' src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-lifecycle.ts
printf '%s\n' '--- lifecycle error and page-removal call sites ---'
rg -n -F --glob 'remote-browser-stream-lifecycle.ts' -e 'remoteBrowserStreamUnsupportedError' -e 'closeMissingRemotePage' -e 'handleStream' -e 'restartForViewport' -e 'startStream' src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-lifecycle.ts

Repository: stablyai/orca

Length of output: 9676


Pass the explicit placement preference to the availability guard.

BrowserPane mounts RemoteBrowserPagePane for non-client-hosted handles. If screencast setup later fails because the runtime lacks browser.screencast.v1, the lifecycle marks the stream stopped; it does not remove the page or its context menu.

That action passes placementPreference: 'server', but the availability guard drops it and can allow the request when hosting is disabled. Creation then skips client placement and creates a server-hosted page that cannot stream to the desktop.

Suggested fix
+import type { BrowserClientHostPlacementPreference } from '../../../shared/browser-client-host-placement'
 import type { RuntimeStatus } from '../../../shared/runtime-types'

 export function runtimeHostsPagesOnThisDesktop(
   state: RuntimeBrowserHostingState,
-  runtimeEnvironmentId: string
+  runtimeEnvironmentId: string,
+  preference?: BrowserClientHostPlacementPreference
 ): boolean {
   ...
   return expectsBrowserClientHosting({
     enabled: state.settings?.browserClientHostedRemoteEnabled !== false,
-    preference: undefined,
+    preference,
     deviceScope: status?.deviceScope,
     capabilities: status?.capabilities
   })
 }

 export function assertRuntimeManagedBrowserCreationAvailable(
   state: RuntimeBrowserHostingState,
-  runtimeEnvironmentId: string
+  runtimeEnvironmentId: string,
+  preference?: BrowserClientHostPlacementPreference
 ): void {
   ...
-    !runtimeHostsPagesOnThisDesktop(state, runtimeEnvironmentId)
+    !runtimeHostsPagesOnThisDesktop(state, runtimeEnvironmentId, preference)
 }
-  assertRuntimeManagedBrowserCreationAvailable(useAppStore.getState(), environmentId)
+  assertRuntimeManagedBrowserCreationAvailable(
+    useAppStore.getState(),
+    environmentId,
+    args.placementPreference
+  )

@nwparker
nwparker merged commit 552691f into main Oct 28, 2026
49 checks passed
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.

1 participant