Skip to content

[Bug]: preview_snapshot can fail or time out on loaded pages and leave tab automation unusable #3713

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. Serve any local web page:

    python -m http.server 8000 --directory build/site
  4. Open the page in a fresh preview tab:

    {
      "show": true,
      "reuseExistingTab": false,
      "url": "http://localhost:8000/index.html"
    }
  5. Confirm the page is loaded with preview_status.

  6. Call preview_snapshot.

  7. Retry preview_snapshot if the first call fails.

  8. Call a simple preview_evaluate afterward:

    ({ href: location.href, ready: document.readyState })

Expected behavior

On a loaded page, preview_snapshot should return page state or a clear recoverable error.

A snapshot failure should not poison the tab. Follow-up preview_evaluate should continue to work, and preview_open(show: true) should recover the tab if the preview needs to be reattached.

Actual behavior

On a loaded page, the first snapshot returned a generic execution error:

{
  "error": {
    "_tag": "PreviewAutomationExecutionError",
    "operation": "snapshot",
    "failureCount": 1
  }
}

A retry timed out after 15 seconds:

{
  "error": {
    "_tag": "PreviewAutomationTimeoutError",
    "operation": "snapshot",
    "failureCount": 1
  }
}

A simple preview_evaluate immediately afterward also timed out:

PreviewAutomationTimeoutError: Preview automation evaluate timed out after 15000ms.

Reopening the same tab with preview_open(show: true) did not restore evaluation in this run. Creating a fresh tab did restore evaluation.

In another run, snapshot failed with an UnknownVizError in the action timeline, while evaluation stayed responsive. This suggests there may be more than one snapshot failure mode.

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

Representative timeout:

PreviewAutomationTimeoutError: Preview automation evaluate timed out after 15000ms.

Representative snapshot error:

{
  "error": {
    "_tag": "PreviewAutomationExecutionError",
    "operation": "snapshot",
    "failureCount": 1
  }
}

Screenshots, recordings, or supporting files

No screenshot included. The page was loaded and inspectable by status before snapshot; the useful evidence is the snapshot/evaluate error sequence.

Workaround

Use preview_evaluate and preview_status for inspection when a full snapshot is not required. If snapshot or a follow-up evaluation starts timing out, abandon that tab and open a fresh one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions