Skip to content

[Bug]: preview_open(show: true) can load a tab without showing it to the user #3718

Description

@gregbartell

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Start T3 Code Desktop.

  2. Open a Codex-backed thread with the T3 preview MCP tools available.

  3. Save this minimal page as open-visible-repro.html:

    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <title>T3 Preview Open Visibility Repro</title>
      </head>
      <body>
        <h1>T3 Preview Open Visibility Repro</h1>
        <p id="ready">Loaded</p>
      </body>
    </html>
  4. Serve the directory containing that file:

    python -m http.server 8000
  5. Call preview_status.

  6. Call preview_open with show: true, reuseExistingTab: true, and the page URL:

    {
      "show": true,
      "reuseExistingTab": true,
      "url": "http://localhost:8000/open-visible-repro.html"
    }
  7. Optionally call preview_open again with show: true and the returned tabId:

    {
      "show": true,
      "reuseExistingTab": true,
      "tabId": "<returned tabId>"
    }
  8. Verify that the loaded page is still available to automation:

    ({
      title: document.title,
      ready: document.querySelector("#ready").textContent
    })

Expected behavior

When preview_open(show: true) returns, the preview panel should be displayed to the user and the returned status should report visible: true.

If the browser cannot be shown, the tool should report a clear failure or return a state that explains why the tab is not visible.

Actual behavior

preview_open(show: true) returned a usable tabId, loaded the URL, and allowed later automation, but reported visible: false:

{
  "available": true,
  "visible": false,
  "tabId": "tab_h",
  "url": "http://localhost:8000/open-visible-repro.html",
  "title": "T3 Preview Open Visibility Repro",
  "loading": false,
  "viewportSetting": { "_tag": "fill" },
  "viewport": { "width": 1280, "height": 800 }
}

Calling preview_open(show: true) again with the same tabId still returned visible: false.

The page was loaded and available to automation despite visible: false:

{
  "title": "T3 Preview Open Visibility Repro",
  "ready": "Loaded"
}

Later operations in the same session caused the same tab's visibility state to move between false and true, so agents cannot infer from show: true that the user can actually see the preview.

Impact

Major degradation or frequent failure

Version or commit

T3 Code desktop 0.0.28-1 via t3code-bin AUR package.

Environment

Arch Linux x86_64, kernel 7.0.13-arch1-1, T3 Code desktop AppImage package via t3code-bin, Codex provider.

Logs or stack traces

No stack trace. The relevant evidence is the returned preview_open status above.

Screenshots, recordings, or supporting files

Minimal repro page attached above. A screenshot can show whether the human-visible preview panel opened, but the core bug is visible in the tool return state: show: true returns a loaded tab with visible: false.

Workaround

Treat visible as user display state only, not as an agent automation capability signal. Verify whether the tab is usable with preview_evaluate, preview_wait_for, or URL/title fields from preview_status. If the user-visible browser matters, manually reopen or create a fresh tab.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions