You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: A timed-out preview_evaluate keeps running in the renderer and makes all preview tools report "No preview automation host" until it finishes #16264
After the #12535 fix the automation host does recover from a preview_evaluate timeout, but only once the timed-out script finishes on its own. The 15 s server deadline doesn't cancel the evaluate in the renderer. Until the stale promise settles, every preview tool on every tab of the environment fails, and the error says not to retry.
Steps to reproduce
preview_open any page in a background tab, e.g. https://example.com (open: false).
preview_evaluate on that tab: new Promise(r => setTimeout(() => r("late"), 40000)).
After 15 s the call fails with Preview automation evaluate timed out after 15000ms.
Immediately call preview_snapshot on that tab and on a different, healthy tab.
Wait about 30 more seconds and call preview_snapshot again.
Expected: the timed-out evaluate is cancelled, or at least scoped to its own tab, and later calls on any tab work right away.
Actual:
Step 4: both snapshots fail with No preview automation host is available for snapshot in environment … Do not retry. … ask the user to open this thread in the T3 Code desktop app, although the desktop app is open and connected.
Step 5: everything works again. The action timeline then shows the original evaluate as succeeded, finishing about 40 s after it started, which means the client kept running it after the server gave up.
Why it matters
One slow script takes down automation for every tab in the environment, including tabs the user is looking at.
The "Do not retry" wording tells agents to give up on preview tools permanently, but the condition is temporary.
Hidden tabs (open: false) throttle timers, so an evaluate that is fast in a visible tab can easily go past 15 s in a background tab and trigger this.
Suggested fixes
Cancel or abandon the renderer-side evaluate when the broker deadline passes, or keep the host registered while a stale request is still pending.
If the host is temporarily busy, report it as retryable (for example "host busy with a timed-out request; retry in a few seconds") rather than "No preview automation host is available … Do not retry".
Environment
Server environment: remote Linux worktree; desktop client on macOS.
Activity