Repository navigation
Fix remote server browser tab fallback behavior - #14194
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughBrowser 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)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
src/renderer/src/lib/workspace-browser-tab-open.test.tssrc/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.
64853c0 to
3aed34a
Compare
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
src/renderer/src/components/browser-pane/BrowserPane.remote-link-routing.test.tssrc/renderer/src/components/browser-pane/BrowserPane.tsxsrc/renderer/src/lib/workspace-browser-tab-open.test.tssrc/renderer/src/lib/workspace-browser-tab-open.tstests/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
* 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)
* 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)
* 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
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
BROWSER_SCREENCAST_RUNTIME_CAPABILITYconstant to replace hardcoded capability stringsisExpectedRuntimeBrowserRoute()to check capabilities directly from runtime state instead of availability policiesWhy
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
Review
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)