Skip to content

Test: Remote Browsing in Agents Window #345466

Closed

Description

@kycutler

Refs: #331926, #343571, #345102

Complexity: 5

Create Issue


The integrated browser in the Agents window can use a session's agent host for networking. This lets you browse localhost apps and other sites accessible from that host directly from the integrated browser.

Setup

In the agents window:

  • Use recent VS Code Insiders builds for both the client and the VS Code agent host.
  • Enable workbench.browser.enableRemoteProxy and leave workbench.browser.dataStorage set to default.
  • Connect to a remote host, such as SSH, WSL, or a dev container, and start a session with a folder.
  • Run a web app on the remote host's localhost.
  • Cloud sandboxes and other non-VS Code agent hosts are not yet supported.

Please comment with the host types you tested, and include the host type in any issues you file.

Browsing through the remote host

  • Open the app in the integrated browser using its original localhost URL. Verify that the page, scripts, images, and API requests load without port forwarding.
  • Share the page with the agent and ask it to interact with the app. Also ask the agent to open a new page.
  • Verify that the remote indicator identifies the correct host.
  • Browse a public HTTPS site. Exercise both HTTP and HTTPS URLs, since they use different proxy paths.
  • Try an unused port and an invalid hostname. These should fail rather than leave the browser stuck indefinitely.
  • Exercise WebSockets, such as live updates or hot reload.

Multiple sessions and hosts

  • Open a local session and a remote session. If possible, also connect to a second remote host.
  • Run apps with visibly different content on the same localhost port on each host.
  • Open browser tabs from each session and verify that they reach the correct server.
  • Switch sessions, navigate existing tabs, and use the agent's browser tools. Existing tabs should retain their original network rather than follow the active session.
  • Ask an agent to open a page while another session is active. The new page should use the requesting agent's host.

New-session composer

  • With a remote host and folder selected, open a browser tab before sending the first message.
  • Change to another remote host or change the folder on the remote host, then start the session.
  • Verify that the tab follows the draft's host and keeps its URL.
  • Verify that tabs belonging to existing sessions are unaffected.

Storage and restoration

Use tabs you open yourself for these checks. Agent-opened pages use separate, in-memory storage per chat.

  • Set a cookie or localStorage value in the remote app.
  • Open another session for the same folder on the same host, then open the same site yourself. Verify that the stored data is shared. Include sessions using worktrees of the same project.
  • Open the same site from a different folder or host. Verify that the stored data is separate.
  • Reload the Agents window and reopen the tabs. Verify that they use the correct host and retain their persistent data.

Disconnects and repeated use

  • Disconnect the remote host and verify that the indicator reports the disconnected state.
  • Reload or navigate an existing remote tab. It must not silently fall back to the local network.
  • Reconnect the host and reload the page. Browsing should work again.
  • Open several pages concurrently, try a large download or streaming response, and repeatedly close and reopen tabs. Watch for stuck pages or failures to open new connections.

Settings

  • Disable workbench.browser.enableRemoteProxy and manually open a new tab. Verify that it uses the local network. Re-enable the setting afterward.

Activity

  1. added this to the 1.145.0 milestone on Nov 2, 2026
  2. dmitrivMS commented on Nov 3, 2026

    @dmitrivMS
    Collaborator

    Remote browsing TPI results

    Tested #345466 in Code OSS on Windows x64, with a local session and two Windows VS Code agent hosts over private, authenticated Dev Tunnels. Client and both remote hosts were built from ccbfe2802f57d4bb69c478c7790c829ec486f75e (1.146.0; client Electron 43.8.3).

    Bugs filed

    Both issues are assigned to Kyle Cutler (@kycutler) and linked to this TPI.

    Coverage

    Area Result
    Remote localhost HTML, JavaScript, CSS, images, API requests Passed on both hosts, without forwarding the app port
    Public HTTP and HTTPS Passed, with the expected remote indicator
    Unused ports and invalid hostnames Explicit errors for HTTP and HTTPS in 170-309 ms; no indefinite loading
    WebSockets Remote greeting and echo passed on both hosts
    Shared page and agent browser tools Agent read the shared page, clicked twice, and opened a new remote page; independently verified DOM results
    Three-network isolation Same 127.0.0.1:43187 URL reached distinct local, host-1, and host-2 apps
    Session switching and background agent Existing tabs kept their original network; a remote agent opened a remote page while the local session was active
    New-session composer Initial remote draft browsing passed; changing folder/host lost the tab: #345692
    Persistent storage Cookie/localStorage shared across same-folder sessions and linked worktrees of the same project; isolated across folders and hosts
    Window reload Restored remote URLs, host selection, cookies, and localStorage
    Disconnect/reconnect Disconnected navigation failed closed; local server log confirmed no fallback request. Reconnect plus reload restored remote browsing. Host-name regression: #345695
    Streaming and large response 225-byte stream arrived incrementally in 10 reads; exact 16,778,240-byte response completed
    Concurrent/repeated browsing Six simultaneous pages plus 20 complete open/navigate/WebSocket/close cycles passed; no leftover test pages
    Disable/re-enable remote proxy Newly opened tab used the local server when disabled and the remote server after re-enabling

    Setup, limits, and cleanup

    • workbench.browser.enableRemoteProxy was enabled and workbench.browser.dataStorage remained default. The proxy setting was restored to enabled after its test.
    • Code OSS required the public tunnel authentication configuration from Insiders as a temporary, gitignored product override. No product source was changed.
    • Local pnpm run install-fast, pnpm run build-fast, and pnpm run electron completed successfully. The remote source builds were also prepared successfully.
    • WSL was not tested: the local machine has no installed WSL distributions. SSH, dev containers, and other operating systems were not covered.
    • Evidence consists of screenshots plus live DOM, browser-network, and server-request-log assertions. No video was recorded.
    • Test-only local/remote servers and private tunnels were cleaned up. Production agent hosts were left untouched.
  3. dmitrivMS commented on Nov 3, 2026

    @dmitrivMS
    Collaborator

    Local WSL follow-up for #345466

    Installed Ubuntu 24.04.5 LTS locally under WSL2 and completed the additional testing. This supersedes the earlier "WSL not tested" limitation.

    Environment

    • Windows client: Code OSS 1.146.0, Electron 43.8.3.
    • WSL 2.7.14.0, kernel 6.18.33.2-microsoft-standard-WSL2, x64, NAT networking.
    • Client and tested Linux agent host: ccbfe2802f57d4bb69c478c7790c829ec486f75e.
    • Installation needed no elevation or Windows reboot.
    • Normal WSL discovery and automatic server installation worked. The downloaded 1.145.0 Insiders host lacked the new proxy capability and correctly displayed the unsupported-host warning. I therefore built the current source in an independent Linux checkout and selected it through the supported WSL dev-command setting, using the repository's existing IPC launcher. No product patches, mock agents, or mock model endpoints were used.

    Results

    Scenario Result
    WSL-only localhost app, HTML/JS/CSS/SVG/API Passed
    Identical Windows/WSL localhost ports Passed: Windows served local, WSL browser served wsl
    WebSockets Greeting and echo passed
    Public HTTP and HTTPS Passed
    Unused port and invalid hostname, both protocols Explicit errors in 285-580 ms
    Shared page and real agent browser tools Passed: agent read the page, clicked twice, opened a new WSL page with separate in-memory storage
    Background agent Opened a WSL page while the Windows session remained active
    Same-folder and linked-worktree storage Cookie/localStorage shared correctly
    Different folder and Windows storage Isolated correctly
    Window reload Correct URL, WSL host, and persistent data restored; a fresh API request confirmed actual WSL routing
    Disconnect and reconnect Failed closed in 258 ms; Windows request log confirmed no fallback. Reload after reconnect restored WSL content, storage, and WebSocket echo
    Streaming and large response 140 bytes in 11 reads / 1.526 s; exact 16,777,216-byte response / 4.005 s
    Concurrent/repeated pages Six concurrent pages plus 20 complete open/navigate/echo/close cycles passed; no leftover stress pages
    Proxy disabled/re-enabled New tab switched to Windows localhost when disabled, then back to WSL when re-enabled

    Existing bugs confirmed on WSL

    No additional WSL-specific browser regression was found in the exercised scenarios.

    Validation and evidence

    • wsl.exe --install Ubuntu-24.04 --no-launch --web-download --version 2: passed.
    • Native Linux pnpm run install-fast: passed.
    • Native Linux pnpm run build-fast --client-only: passed.
    • Live Code OSS validation used screenshots, DOM assertions, browser network requests, and the Windows comparison server's request log; no video was recorded.
    • WSL remains installed. Test-only processes, credentials, and isolated profiles were cleaned up; the Linux source checkout/build and small test Git project were retained for reuse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions