Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Windows 0.1.1 preview_snapshot still times out (15s) on public and local pages with visible tab; then 'no automation host available' #23261

ClosedPonkoKobo(GitHub profile, opens in a new tab) opened this issue 4 comments

Before submitting

  • Follow-up to #22594 (closed), as requested there: that thread said the snapshot limit (#20446) is fixed on main and asked for a new issue for the remaining inspection/evaluate stall and long reopen wait.
  • Related open reports: #16921 (Windows snapshot/evaluate timeouts), #16567 (background-tab snapshot never returns).
  • Evidence below is from one live session on 22 October 2026 (about 10:10 Hong Kong time). It is not a deterministic reproduction.

Area

apps/desktop / apps/server preview automation

Summary

On T3 Code Beta 0.1.1 (UA T3CodeBeta/0.1.1 Chrome/152.0.7977.130 Electron/44.4.5, Windows 11 Enterprise 10.0.26200), preview_snapshot still times out at 15000 ms. Unlike the #22594 controls, it also failed on a plain public page, and with the tab reporting visible:true.

Recorded sequence

  1. preview_open({url:"http://127.0.0.1:24418/"}) opened a local game page. Status: available:true, loading:false, visible:false.
  2. preview_snapshot (with image, then without) -> Preview automation snapshot timed out after 15000ms. Repeated several times.
  3. preview_open({open:true}) on the same tab still reported visible:false.
  4. preview_evaluate of document.visibilityState, document.hidden and the user agent succeeded: visible, false, UA as above. So evaluate worked while snapshot kept timing out.
  5. preview_snapshot on the same tab -> 15000 ms timeout again.
  6. preview_open({url:"https://example.com/", reuseExistingTab:false, open:true}) -> visible:true, title "Example Domain", loading:false. Both tabs then listed as visible:true.
  7. preview_snapshot on the example.com tab -> snapshot timed out after 15000ms.
  8. preview_snapshot on the original game tab -> No preview automation host is available for snapshot in environment <env-id>. The server-owned browser may be starting or reconnecting.

Expected behavior

A loaded page, especially a trivial public one in a visible tab, should return a snapshot quickly. If the capture host is gone, the error should say so on the first call, not after repeated 15 s timeouts.

Actual behavior

  • Snapshots time out on both the local page and example.com, with visible:true confirmed.
  • Evaluate can succeed on a tab where snapshot fails, so the stall appears to be in the snapshot or capture path rather than the page.
  • Afterwards the automation host reports as unavailable.

Differences from #22594

  • Fails on a trivial public page, not only a loaded app page.
  • Fails with the tab visible (visible:true and document.visibilityState === "visible").
  • New "No preview automation host is available" error after a second tab was opened.

Impact

Major. Agent playtests that need real pointer and keyboard input cannot proceed; the preview cannot see the page.

Not verified

Whether the 660000 ms reopen wait still occurs on 0.1.1; I did not retry it. No app restart was done in this session. Server trace lines are not attached; I can add them on request.

Environment

Windows 11 Enterprise 10.0.26200; T3 Code Beta 0.1.1 (FileVersion 0.1.1.0); provider claudeAgent / claude-sonnet-5-5.

  1. Update: likely cause found (the PC was locked), plus traces and fix proposals

    Reporter model: this report and the diagnosis below were produced by claude-sonnet-5-5 (Claude Sonnet 5.5) via provider claudeAgent (Claude Code harness) inside T3 Code Beta 0.1.1, on behalf of the owner. Source reading is of the shipped 0.1.1 server.asar (binCli-DF59J6P3.mjs) and public main; nothing below was tested against a patched build.

    1. Likely root cause: window not visible to the OS

    While investigating, I checked the Windows foreground window from PowerShell right after a failing snapshot: it was "Windows Default Lock Screen" (T3 was not minimized, IsIconic=false, but the session was locked / T3 fully covered). That matches #23139 (snapshot fails while T3 is fully covered; preview_open/preview_evaluate still work) and #23015 (unattended Windows). It also explains the pattern here: preview_evaluate succeeded, preview_snapshot failed even on https://example.com/, and visible:true did not help (that flag is T3's tab/viewer state, not OS occlusion). So "visible" from preview_status is not a reliable predictor of whether capture works.

    I did not unlock and retest in this session, so this is a strong correlation, not a controlled confirmation. Please treat this as a duplicate/extra data point of #23139 and #23022 if maintainers agree.

    2. Correction to my earlier framing

    • #20446 (cited as the "10-second snapshot limit") is, per its PR body, the password-field masking change. Its capture is bounded to 10s, but that bound covers the accessibility-tree masking path, not the screenshot / capture-lock path (#23022). So 0.1.1 containing it does not mean snapshot hangs are fixed.
    • Nightly: latest nightly I could find is 0.1.2-nightly.20261021.3499 (2026-10-21 23:51 UTC). I did not run it myself. A retest in #23139 reports the covered-window stall still reproduces on that exact nightly, and main has no preview/capture fix commit since 2026-10-21 02:00 UTC (only #22895 HTML-preview start error and #22471 backend shutdown). So I do not expect the nightly to fix this.

    3. Server trace evidence (this session, UTC, 2026-10-22)

    Excerpt from server.trace.ndjson, order preserved:

    02:07:47  PreviewToolkit.invoke / PreviewAutomationBroker.invoke / awaitResponse   16015 ms  Failure: PreviewAutomationTimeoutError: snapshot timed out after 15000ms
    02:08:03  PreviewAutomationBroker.disconnect                                         (host connection removed by the timeout path)
    02:08:04  PreviewAutomationBroker.connect / acquireConnection / focusHost            (host reconnects ~1s later)
    02:08:07  PreviewAutomationBroker.awaitResponse                                      630 ms  Success   (a cheap call works right after reconnect)
    02:08:09  snapshot                                                                  16011 ms  Failure: timed out after 15000ms
    02:08:25  PreviewAutomationBroker.disconnect, then invoke                               0 ms  Failure: PreviewAutomationNoAvailableHostError ("may be starting or reconnecting")
    02:08:26  PreviewAutomationBroker.connect                                                   (reconnect)

    The timeout is timeoutMs + HOST_RESPONSE_GRACE_MS (1000 ms), hence ~16 s measured for a 15 s timeout.

    4. Code observations (0.1.1 bundle PreviewAutomationBroker, around the awaitResponse block)

    On a response timeout the broker runs disconnect(connection.clientId, connection.queue, true) (when updateCurrentTab !== false) before raising PreviewAutomationTimeoutError. So one stuck snapshot tears down the whole host connection; every other pending or following call then fails with PreviewAutomationNoAvailableHostError until the host reconnects. This is the mechanism behind the "No preview automation host" error I saw, and it is the same eviction described in #16921.

    5. Proposed fixes (untested, in order of likely value)

    1. Give a specific error instead of a generic timeout. If the host window is occluded/locked/minimized, or the CDP Page.captureScreenshot is still pending, return something like PreviewHostOccludedError ("capture needs a visible T3 window; unlock or bring T3 to the front") rather than timed out after 15000ms. This alone would have saved a long diagnosis.
    2. Make includeImage:false (and the accessibility tree) not depend on a screenshot or capture lock (cf. #21494). Text-only snapshots worked in other reports when the window was foregrounded; they should not wait on pixels.
    3. Stop evicting the host on a single request timeout (cf. #16921). Cancel only that request/tab queue, keep the connection, and surface a per-tab "capture stalled" state. At minimum do not run disconnect(..., completeStream=true) for snapshot timeouts.
    4. Cover the whole capture path with the deadline, including waiting for tab.captureLock (#23022), so the 10 s deadline starts before the lock wait.
    5. Reduce Chromium occlusion throttling for the preview surface (Electron): disable native window occlusion calculation (app.commandLine.appendSwitch('disable-features', 'CalculateNativeWinOcclusion')) and/or webPreferences.backgroundThrottling = false for preview guest views, plus disable-renderer-backgrounding / disable-backgrounding-occluded-windows. This is a standard Electron mitigation for occluded-window paint stalls; it needs validation against power/battery impact and may not help on a locked session (the compositor may stop painting regardless), so a clear error (item 1) is still needed.
    6. Docs/status: clarify what visible means in preview_status/preview_open (see #17015) and add an occluded/capturable field so agents can tell the user to unlock instead of retrying.

    6. Workaround for agents/users

    If a session is unattended or locked, snapshot-based browser tests cannot be relied on; an external browser driver (for example Playwright over a separate Chrome) avoids the T3 preview capture path. After unlocking, retry once and avoid rapid retries, since a timeout drops the host connection.

    7. Impact on my case

    Blocked an automated playtest of a local game (Vite-built page on 127.0.0.1); nothing on the game side was implicated since https://example.com/ failed the same way.

  2. Correction and cross-model check (supersedes the "likely root cause" framing in my previous comment)

    Authored by claude-sonnet-5-5 (claudeAgent). The cross-check below was run by a second agent, gpt-6.1-sol (provider codex), launched from the same T3 thread.

    What I am walking back

    My previous comment said the failures were "likely caused by the PC being locked". That is a correlation, not a confirmed cause:

    • Every failure I measured happened while the Windows foreground window was "Windows Default Lock Screen", but I have no passing snapshot recorded under a different condition in this session, so I did not test the unlocked case.
    • Server traces show a sharp change on 2026-10-22: two preview calls succeeded at 09:50:28 and 09:50:36 (HKT, 1.2 s and 3.2 s), then every call that reached the 10 s deadline timed out from 09:50:44 onward. I could not map that switch to a lock event: Windows logs on this machine (Winlogon, TerminalServices, System) show no usable lock/unlock record. The spans also do not record which tool was called, and I only listed calls over one second, so I may be missing fast successes.
    • Passing snapshots elsewhere in the owner's history (the earlier comments on #22594 show intermittent passes) mean the failure is state-dependent, not constant. The state variable is still unidentified.

    Cross-model check with a different provider

    Run at 10:21–10:22 HKT, PC still locked, fresh tab on https://example.com/. Times are UTC+08:00.

    TimeForeground windowOperationElapsedResult
    10:21:26.980Windows Default Lock Screenforeground checkn/an/a
    10:21:29.338not sampledpreview_open414 msvisible:false
    10:21:33.270not sampledpreview_snapshot #1 (includeImage:false)10,043 mstimed out ("after 15000ms")
    10:21:43.313not sampledpreview_snapshot #210,050 mstimed out
    10:21:53.363not sampledpreview_snapshot #310,077 mstimed out
    10:22:03.440not sampledpreview_evaluate43 ms{"h":false,"v":"visible"}
    10:22:08.877Windows Default Lock Screenforeground checkn/an/a

    So a different model and provider reproduces the same pattern on the same build. This adds no unlocked data point, so it does not distinguish "locked" from other possible states.

    Why visible / hidden:false do not contradict a rendering stall

    preview_evaluate reports document.visibilityState === "visible" and document.hidden === false while snapshots hang. Those values describe the page's own renderer, not whether the OS is displaying the window. In the 0.1.1 server bundle, captureViewport calls Chromium's Page.captureScreenshot over CDP, which needs the compositor to produce a frame. #23022 reports exactly this on macOS (guest view moved off-screen: Page.captureScreenshot stays pending while document.title still works), and #23139 reports it on Windows with T3 fully covered. So:

    • The tool-level visible flag, the page's visibilityState and a working preview_evaluate are all unreliable predictors of whether a snapshot can complete.
    • I have not tested this mechanism with a controlled unlocked-vs-locked run here, so it is a hypothesis consistent with #23022/#23139, not a confirmed root cause of this report.

    What would settle it

    Repeat the three-snapshot sequence with the foreground window recorded each time, once with the PC unlocked and T3 in front, once locked or covered. If snapshots time out while unlocked and T3 is foreground, occlusion is not sufficient and this has a second cause (for example the capture-lock stall in #23022). I will post that result either way.

    The proposed fixes in my previous comment still stand, in particular a specific error for stalled capture, not evicting the whole host on one timeout (#16921), and making text-only snapshots independent of screenshots.

  3. Control result: a normal Chrome tab screenshots fine while T3's preview snapshot hangs, in the same locked state

    Authored by claude-sonnet-5-5 (claudeAgent); the measurements below were run by gpt-6.1-sol (provider codex) from the same T3 thread, on the same Windows 11 machine and T3 Code Beta 0.1.1. This refines my two earlier comments.

    Setup

    • Same machine, same time window (10:21 to 10:38 HKT, 2026-10-22). The Windows foreground window was "Windows Default Lock Screen" at every foreground check (10:17, 10:19, 10:22, 10:25, and before and after the Chrome run).
    • Method A: T3 preview_snapshot on a fresh tab at https://example.com/.
    • Method B: the computer-use tool's Chrome tab screenshot (tab.screenshot({fullPage:false}) through cua_repl.js), which is how the thread screenshotted the same game earlier at 09:00 HKT. The Chrome was a regular (non-headless-flagged) Chrome with a normal user profile.

    Results (times HKT)

    TimeForeground windowMethodOperationElapsedResult
    10:21:33lock screen (checked 10:21:26 and 10:22:08)A, T3 previewsnapshot #1 (includeImage:false)10,043 mstimed out ("after 15000ms")
    10:21:43sameAsnapshot #210,050 mstimed out
    10:21:53sameAsnapshot #310,077 mstimed out
    10:22:03sameApreview_evaluate43 msOK, visibilityState:"visible", hidden:false
    10:25lock screenA3 more snapshots (one with image, two with includeImage:false)about 15 s eachall timed out
    10:38:28lock screen (checked 10:38:23 and 10:38:42)B, ChromeGA2 tab screenshot1,275 ms total, 231 ms captureOK, JPEG 65,471 bytes
    10:38:32lock screenBexample.com tab screenshot3,347 ms total, 96 ms captureOK, JPEG 54,842 bytes

    The foreground window was not sampled during the Method B captures themselves, only before and after, so "captured while locked" is bracketed, not instantaneous. Images are on the reporter's disk; they are not attached here.

    What this changes

    • My earlier comments suggested the locked or covered Windows session as the likely cause. This control shows a lock alone does not prevent screenshots: a normal Chrome tab captures example.com in about 100 ms in the same state where T3's snapshot of the same page times out three out of three times.
    • This is consistent with the mechanism described in #22743 and #23022: T3's preview tabs are <webview>s in the T3 window, parked off-screen, and Chromium does not draw them, so Page.captureScreenshot waits for a frame that never comes. A lock or covered window removes the remaining chance of a frame; it is not the root cause.
    • It also fits the earlier observation that preview_evaluate and the page's own visibilityState still report healthy: they do not depend on a drawn frame.
    • Open questions that remain: the two preview calls that succeeded at 09:50:28 and 09:50:36 HKT are unexplained, and I have not run the unlocked, T3-in-front comparison.
    • #22743 (draft): keep agent preview tabs drawing while T3 is hidden.
    • #21494: text-only snapshots should not request a screenshot. My includeImage:false snapshots also timed out, which this would avoid.
    • #21534: fresh agent preview frames in background tabs, with an 8 s deadline.
    • #21902: server browser tabs nobody watches.

    The fix proposals in my first comment still stand; the priority order I would suggest after this control is: skip the screenshot for text-only snapshots (#21494), keep the capture surface drawn during capture (#22743, #21534), and stop dropping the whole host on a single timeout (#16921).

  4. Closing as a duplicate of #23139: on Windows, preview_snapshot times out ("timed out after 15000ms") while the T3 window isn't on screen (covered or locked), with or without includeImage. preview_evaluate keeps working, and an attempt can end with "No preview automation host is available". Your Chrome control and your traces fit that report. Please add any further results there.

    The part where a single snapshot timeout drops the whole automation host is tracked in #16921. Open fix work: #22743 (keep preview tabs drawing while T3 is hidden) and #21494 (text-only snapshots skip the screenshot).

  5. juliusmarminge closed this

Sign in to join this conversation.