Skip to content

[Bug]: preview_open ignores an explicit desktop tabId and creates a new server tab #19718

Closed

Description

@kendonB

Apologies if this is slop nonsense (GPT 6.1 Sol Xhigh). Sol thinks this is a bug related to Windows browser control not really working from within WSL.

In Windows T3 connected to WSL, preview_open reports success for an existing desktop tab ID but returns a newly created WSL server tab. The original tab remains listed. The agent is now working in a different browser tab from the one requested.

Area

apps/server

Steps to reproduce

  1. Connect Windows T3 Code to a WSL environment.

  2. Open a preview and choose Open on this computer, leaving a desktop-hosted tab in the thread.

  3. Use t3_preview_list to get that tab's ID. In this reproduction it was tab_4, and it was the only listed tab.

  4. Call:

    {"tabId":"tab_4","url":"https://example.com/","open":true}
  5. Compare the returned ID with the requested ID, then call t3_preview_list again.

Expected behavior

preview_open should use the requested tab. If the WSL agent cannot control that desktop tab, it should return an error explaining that limitation and create no new tab.

The tool description says: “Pass tabId to reuse a specific existing tab.”

Actual behavior

The call succeeds with a different ID. Relevant response fields:

{
  "available": true,
  "tabId": "tab_6_bc78bc2c-aaac-4b21-bd05-8eaf29f0353d",
  "title": "Example Domain",
  "url": "https://example.com/"
}

The tab count increases from 1 to 2. tab_4 remains listed with its previous URL, while the new tab has runtime: "server". The original tab's page contents were not captured; its continued presence and unchanged URL were checked through T3 metadata.

The requested destination is a public page, so this reproduction does not depend on authentication.

Impact

The agent receives a successful result for the wrong tab. This prevents it from continuing work in the desktop tab selected by the user.

Version and environment

  • Windows desktop and WSL server: 0.0.46-nightly.20261014.3118
  • Commit: 7ac952c630ef8a60d14ca8f6a0c7adce33db4bae
  • Windows 11 Business, build 10.0.26200
  • Ubuntu 24.04.5 LTS, WSL2 kernel 6.6.87.2-microsoft-standard-WSL2
  • Agent provider: Codex

Source findings

In this release, findTab filters listed sessions to runtime === "server". The open handler catches ServerBrowserTabNotFoundError, treats the requested tab as absent, and creates a new tab with runtime: "server".

This explains the observed result. Even when desktop-tab automation is unsupported, an explicit target should not silently become a new tab.

Related issue

#17090 describes the Windows/WSL browser connection and rendering limitations. This report concerns the narrower API behavior: an explicit desktop tab ID is silently replaced by a successful new-server-tab result.

Activity

  1. juliusmarminge commented on Oct 15, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    This is a bug in how preview_open handles an explicit tabId. It is not about WSL desktop control, which is out of scope on purpose.

    A WSL server can't drive a tab hosted on the Windows desktop, and that has been by design since #15328. What's wrong is the fallback. On main, findTab in apps/server/src/preview/ServerBrowser.ts only matches runtime === "server" sessions. The open handler turns ServerBrowserTabNotFoundError into undefined and then opens a new server tab, even when tabIdExplicit is set. The agent gets a success result for a tab it didn't ask for. That contradicts the tool description ("Pass tabId to reuse a specific existing tab"). It's also inconsistent with the other preview handlers, which return PreviewAutomationTabNotFoundError for an unknown tab.

    Expected fix: when tabId is explicit and can't be resolved, open should fail. If the tab exists but lives on the desktop runtime, the error should say that, and no new tab should be created. Implicit reuse can keep its current fallback.

    Related but separate: #17090 (Windows/WSL browser limitations) and discussion #15339.

  2. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 15, 2026
  3. seankoji commented on Oct 15, 2026

    @seankoji

    Additional reproduction on 15 October 2026 (AEDT), reported with the user's permission. Agent: Codex in T3 Code. The Linux server service is configured to run 0.0.46-nightly.20261009.2873; the connected desktop version was not independently checked.

    The same explicit-tab fallback blocked a Cloudflare workflow:

    1. The user had two existing Browser tabs open at https://dash.cloudflare.com/profile/api-tokens and reported that both worked and were signed in.

    2. t3_preview_list({limit:50}) listed tab_1 and tab_3, both with title Cloudflare Dashboard | Manage Your Account. Their session records had no explicit runtime field.

    3. preview_status({}) listed only the agent's separate server-runtime tab. It omitted those two user tabs.

    4. Targeting the listed user tab failed:

      {"tabId":"tab_3"}

      preview_snapshot returned:

      Preview snapshot failed: Preview tab tab_3 was not found for snapshot. Omit tabId to use the current tab, or call preview_open.
      
    5. Following that recovery advice with preview_open:

      {"tabId":"tab_3","reuseExistingTab":true,"open":true}

      returned success with a different, newly created blank tab:

      {
        "available": true,
        "visible": false,
        "tabId": "tab_5_<server-epoch>",
        "url": null,
        "title": null
      }

      The epoch suffix above is redacted; the different tab number and blank URL are from the actual response. No URL was requested in this call.

    Earlier agent-created tabs at the Cloudflare URL remained on Performing security verification, while the user reported their existing tabs worked. This illustrates the practical cost of switching browser sessions silently; it does not establish that the fallback causes Cloudflare's verification failure.

    The extra agent-created tabs were closed through t3_preview_close. A subsequent t3_preview_list still listed the two original user tabs. No token permissions or Cloudflare configuration were changed.

    Please preserve an explicit target: if the listed tab is hosted on an unsupported runtime, return that limitation without creating a replacement. The current snapshot recovery advice also sends the agent directly into the misleading successful fallback.

    No credentials, cookies, private transcript, or raw browser logs are included.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions