Skip to content

Fix remote server browser tab fallback behavior - #14194

Merged
AmethystLiang merged 4 commits into
mainfrom
fix-remote-server-clicking
Aug 13, 2026
Merged

AmethystLiang merged 4 commits into
mainfrom
fix-remote-server-clicking

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Problem

When opening URLs in a remote server's browser, the app was falling back to the client browser instead of respecting the user's explicit choice to open on the remote server.

Solution

Changed the browser tab opening logic to directly validate that the target runtime has the browser screencast capability before proceeding. If a specific runtime is requested but lacks the capability or creation fails, the operation now fails cleanly instead of silently falling back to the client browser.

What Changed

  • Imported BROWSER_SCREENCAST_RUNTIME_CAPABILITY constant to replace hardcoded capability strings
  • Refactored isExpectedRuntimeBrowserRoute() to check capabilities directly from runtime state instead of availability policies
  • Added test case ensuring runtime creation failure doesn't trigger client browser fallback
  • Updated function signatures to pass state for direct capability inspection

Why

This approach ensures the browser opens where explicitly requested on the remote server, improving reliability of the remote execution flow.

Visual Proof

N/A — behavioral fix with no UI changes

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
    • Added: "does not fall back to a client browser when asserted runtime creation fails"

Review

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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)

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ad5b97b-ef1b-402b-87f6-8a8485d76eb8

📥 Commits

Reviewing files that changed from the base of the PR and between 1a5c4dd and 3488fd9.

📒 Files selected for processing (1)
  • tests/e2e/paired-remote-browser-link-open-routing.spec.ts

📝 Walkthrough

Walkthrough

Browser runtime route validation now checks application state and requires the expected environment to advertise the browser screencast capability. Workspace and managed-browser eligibility checks use this validation path. Runtime capability assertions use the shared capability evaluation. Tests cover failed runtime creation, floating-terminal restrictions, paired-web behavior, repeated remote browser openings, and remote link routing.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem and solution, but it omits the required ELI5 and Linked Issue sections and leaves required testing checkboxes unchecked. Add the required ELI5 and Linked Issue sections, complete the testing status, and confirm the checklist items or explain why they are not applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: preventing incorrect client-browser fallback for remote server browser tabs.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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: Pro Plus

Run ID: ae115eaa-b7ee-4536-91ca-226757a764f0

📥 Commits

Reviewing files that changed from the base of the PR and between aeb7183 and 64853c0.

📒 Files selected for processing (2)
  • src/renderer/src/lib/workspace-browser-tab-open.test.ts
  • src/renderer/src/lib/workspace-browser-tab-open.ts

Cache the runtime browser capability check across multiple remote port opens instead of checking for each port independently. Prevent floating-terminal workspaces from routing to remote browsers.
@AmethystLiang
AmethystLiang force-pushed the fix-remote-server-clicking branch from 64853c0 to 3aed34a Compare August 13, 2026 05:07
Remote pane link opens must route to the pane's runtime, never the client.
Fails if the workspace has moved to a different host while the pane still
displays a remote page, preventing silent misrouting to a dev server.

@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: Pro Plus

Run ID: cdec6592-d297-4ffe-ac55-894f3e87e922

📥 Commits

Reviewing files that changed from the base of the PR and between 3aed34a and 1a5c4dd.

📒 Files selected for processing (5)
  • src/renderer/src/components/browser-pane/BrowserPane.remote-link-routing.test.ts
  • src/renderer/src/components/browser-pane/BrowserPane.tsx
  • src/renderer/src/lib/workspace-browser-tab-open.test.ts
  • src/renderer/src/lib/workspace-browser-tab-open.ts
  • tests/e2e/paired-remote-browser-link-open-routing.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/lib/workspace-browser-tab-open.ts

@AmethystLiang
AmethystLiang merged commit 939acf1 into main Aug 13, 2026
0 of 42 checks passed
AmethystLiang added a commit that referenced this pull request Aug 13, 2026
* fix(browser): require runtime browser capability

* fix(browser): reuse capability verdict and exclude floating terminals

Cache the runtime browser capability check across multiple remote port opens instead of checking for each port independently. Prevent floating-terminal workspaces from routing to remote browsers.

* fix(browser): pin remote pane link opens to owning runtime

Remote pane link opens must route to the pane's runtime, never the client.
Fails if the workspace has moved to a different host while the pane still
displays a remote page, preventing silent misrouting to a dev server.

* trim comments

(cherry picked from commit 939acf1)
hyoteis pushed a commit to hyoteis/orca that referenced this pull request Aug 15, 2026
* fix(browser): require runtime browser capability

* fix(browser): reuse capability verdict and exclude floating terminals

Cache the runtime browser capability check across multiple remote port opens instead of checking for each port independently. Prevent floating-terminal workspaces from routing to remote browsers.

* fix(browser): pin remote pane link opens to owning runtime

Remote pane link opens must route to the pane's runtime, never the client.
Fails if the workspace has moved to a different host while the pane still
displays a remote page, preventing silent misrouting to a dev server.

* trim comments

(cherry picked from commit 939acf1)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(browser): require runtime browser capability

* fix(browser): reuse capability verdict and exclude floating terminals

Cache the runtime browser capability check across multiple remote port opens instead of checking for each port independently. Prevent floating-terminal workspaces from routing to remote browsers.

* fix(browser): pin remote pane link opens to owning runtime

Remote pane link opens must route to the pane's runtime, never the client.
Fails if the workspace has moved to a different host while the pane still
displays a remote page, preventing silent misrouting to a dev server.

* trim comments
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