[Bug]: preview_resize times out and leaves viewport state internally inconsistent #3712
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#
Start T3 Code Desktop.
Open a Codex-backed thread with the T3 preview MCP tools available.
Serve any local web page and open it in the preview:
python -m http.server 8000 --directory build/site{ "show": true, "reuseExistingTab": false, "url": "http://localhost:8000/index.html" }Call
preview_resizein freeform mode:{ "mode": "freeform", "width": 1920, "height": 1200, "timeoutMs": 15000 }Check both
preview_statusand the live DOM viewport:({ innerWidth, innerHeight, devicePixelRatio })Repeat with
mode: "fill"and with theiphone-12-propreset.Call
preview_snapshotafter the resize attempts.
Expected behavior#
preview_resize should either:
- complete successfully and make
viewportSetting, measuredviewport, live DOMinnerWidth/innerHeight, and snapshot screenshot size agree, or - fail without partially changing tab state.
If exact sizing is impossible, the tool should return the effective viewport and explain the mismatch.
Actual behavior#
Each resize call timed out after 15 seconds but still partially changed state.
After freeform 1920x1200, preview_status reported the requested setting while the measured viewport and live DOM viewport stayed at 1280x800:
{
"viewportSetting": { "_tag": "freeform", "width": 1920, "height": 1200 },
"viewport": { "width": 1280, "height": 800 }
}
{
"innerWidth": 1280,
"innerHeight": 800,
"devicePixelRatio": 2.190890312194824
}
Later, the same requested setting drifted to a measured viewport of 2103x1314.
After a timed-out fill resize, measured and live viewport changed to about 410x987.
After a timed-out iphone-12-pro preset resize, viewportSetting changed to 390x844, but measured and live viewport were about 427x924:
{
"viewportSetting": {
"_tag": "preset",
"width": 390,
"height": 844,
"presetId": "iphone-12-pro"
},
"viewport": { "width": 427, "height": 924 }
}
preview_snapshot also returned a PNG screenshot sized 1280x800 while preview_status reported a measured viewport of 2103x1314.
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 resize failure:
PreviewAutomationTimeoutError: Preview automation resize timed out after 15000ms.
The important diagnostic is that status/live viewport values diverge after the timeout, as shown above.
Screenshots, recordings, or supporting files#
No response
Workaround#
After any resize timeout, treat viewport state as unknown. Measure the effective viewport with preview_evaluate using innerWidth and innerHeight, and compute interaction coordinates from live DOM geometry instead of snapshot coordinates.
gregbartell(GitHub profile, opens in a new tab) added labelsbug
gregbartell(GitHub profile, opens in a new tab) added labelsneeds-triage
fix(preview): freeform resize times out on an available browser tab
Summary#
Supplementary evidence for #3712: three consecutive
preview_resizerequests for a 560 × 760 freeform viewport timed out in a Codex-backed session. A preceding navigation reported an available, loaded tab with a measured 1280 × 800 viewport. Raising the deadline from 15 to 30 seconds did not produce success in this bounded sample. These records establish the timeout symptom, but do not establish the viewport inconsistency in the original issue or the zoom-related cause in #12319.Steps to reproduce#
This is the recorded historical sequence, not a newly executed or minimized reproduction. The exact T3 release at the time of the calls and a known-good resize baseline are unknown.
- Navigate the current collaborative preview tab to a local test page. The retained response reports
available: true,visible: false,loading: false, and both the freeform setting and measured viewport as 1280 × 800. - Call
preview_resizewith{"mode":"freeform","width":560,"height":760}. - After its timeout, call
preview_statuswith{}. The retained response still reports an available, loaded tab and the previous 1280 × 800 setting, but omits the measured viewport. - Retry with
{"mode":"freeform","width":560,"height":760,"timeoutMs":30000}. - A subsequent
preview_openresponse again reports an available, loaded tab with the previous 1280 × 800 setting and measured viewport. - Retry with
{"mode":"freeform","width":560,"height":760,"timeoutMs":15000}. - The next
preview_snapshotcall with{"includeImage":false}returnsPreviewAutomationNoAvailableHostError.
All three recorded resize attempts failed. No successful resize control was retained in this session. A deterministic rerun requires the historical release, original page fixture, and browser host state during those requests, including host/guest zoom, rendering state, and connection transitions. No browser rerun was performed in this investigation.
Expected behavior#
The supported freeform resize operation sets the current tab to the requested CSS-pixel dimensions and returns its setting and measured viewport. The currently inspected contract accepts 560 × 760. On an attached, ready tab, the request should complete with the effective viewport matching the requested dimensions within the implementation's one-pixel rounding tolerance.
Actual behavior#
Attempt Input Recorded lifecycle interval Exact failure text A {"mode":"freeform","width":560,"height":760}15.008 s Preview automation resize timed out after 15000ms.B {"mode":"freeform","width":560,"height":760,"timeoutMs":30000}30.011 s Preview automation resize timed out after 30000ms.C {"mode":"freeform","width":560,"height":760,"timeoutMs":15000}15.006 s Preview automation resize timed out after 15000ms.The next snapshot after Attempt C returned
PreviewAutomationNoAvailableHostError. This sequence does not prove that resize caused host unavailability. No live DOM viewport or zoom measurements were retained during these requests.Evidence#
- Expected source: The inspected Nightly bundle
0.0.46-nightly.20261004.2657declares the freeform resize operation inapps/server/dist/binCli-B1WajSKX.mjsinsideapp.asar. Source breadcrumbs at public commit95030dc674883f0f2a7fd034b32ce742c8cf55d0arepackages/contracts/src/previewAutomation.ts(PreviewAutomationResizeInputandPreviewAutomationResizeResult),apps/server/src/mcp/toolkits/preview/tools.ts(PreviewResizeTool), andapps/web/src/components/preview/previewViewportReadiness.ts(fixed-size matching with one-pixel tolerance). These inspected versions corroborate the input contract; they do not establish the historical failing release. - Failure source: Three retained V2
dynamic_toolrecords namedt3-code.preview_resize, shown inline above, plus the preceding navigation, intervening status/open responses, and subsequent snapshot error. - Evidence provenance: observed
- Local verification: not-run
- Reproduction completeness: incomplete
- Missing fact: The historical failing release, original page fixture, and browser host state during the requests, including host/guest zoom, rendering state, and connection transitions, are unavailable.
Read-only inspection of retained tool records supplies the primary failure evidence. Bundle and source inspection separately corroborate the contract. No browser/GUI reproduction was executed; SQLite inspection used a read-only connection with
query_onlyenabled.Restoration check#
Recover the historical prerequisites or independently reproduce an equivalent case. Repeat the 560 × 760 request on a ready tab. A passing result is a successful response whose setting and measured viewport match the requested dimensions within one-pixel tolerance, instead of consuming the timeout. Independently verify the live DOM viewport and a subsequent successful status/snapshot call. Compare with a known-good control without assuming zoom is the cause.
Affected area#
apps/webpreview automation renderer andapps/serverpreview automation broker, used through the desktop collaborative browser.Runtime or environment#
The historical records identify the Codex provider and a local test page. They do not retain the exact historical T3 release or OS version. The installation inspected for contract corroboration is Nightly
0.0.46-nightly.20261004.2657.Impact#
The three requests consumed approximately 60 seconds across their configured deadlines and returned errors. This bounded sample does not establish population failure frequency.
- Navigate the current collaborative preview tab to a local test page. The retained response reports
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. One part of this is fixed on main in #15328 and #19913. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: preview_resize timeouts and viewport-setting versus measured-state mismatch. If that part still matters to you, please open a new issue for that part only.
t3dotgg(GitHub profile, opens in a new tab) closed this
t3dotgg(GitHub profile, opens in a new tab) linked this to #8469
Sign in to join this conversation.
Still reproduces on
0.0.33, seven weeks after this was filed against0.0.28.Arch Linux x86_64, kernel
7.1.8-arch1-3, Hyprland,t3code-binAUR package from the AppImage, Claude provider via Claude Code as the MCP client.All three modes, on a freshly loaded page#
Against a static local page on
127.0.0.1, opened seconds earlier and confirmed loaded:preview_evaluateanswers correctly immediately before and immediately after every failed resize.preview_set_appearancealso succeeds against the same tab in the same sequence, and its effect reads back from inside the page withmatchMedia. The tab is not poisoned and the automation channel is not wedged.It also timed out on a tab reporting
visible: true#This is the part I think is worth your attention, given how much of #3713 turns on tab visibility.
The status call immediately after the timeout still reported the tab as available and visible. So resize failed on a tab that the server itself described as visible, which suggests this is not simply another face of #3713.
I want to be honest about the limit of that evidence.
visible: truehappened exactly once here and I could not reproduce it afterwards. A fresh tab opened with"show": true, "open": true, "reuseExistingTab": falsecame back"visible": false, and re-showing the existing tab came back"visible": falseas well. I have written that up separately on #3713.Raising the deadline does not help#
I searched every local session transcript on this machine for
preview_resizecalls and their results. There are ten, spanning 2026-08-14 to 2026-08-27, across six sessions and three unrelated projects, plus five more I ran today.All of them timed out. Eight of the ten historic calls hit the 15000ms default, one hit 30000ms and one hit 45000ms after an explicit
timeoutMs. Each failed at its own deadline rather than at 15000ms, so this is not a slow operation that needs longer. It never completes.{mode, width, height}{mode}{mode, width, height, timeoutMs}{mode, timeoutMs}The package was installed here on 2026-08-11 and the first recorded failure is 2026-08-14. I have no record of
preview_resizeever succeeding on this machine, so I cannot say whether this is a regression or has always been broken.One difference from the original report#
On the non-visible tab, three consecutive failed resizes changed nothing at all.
preview_statusreturned byte-identical output before and after, still reporting the pre-existingviewportSettingoffreeform 1280x800. The failed call neither recorded nor applied the requested setting, where the original report saw the requested setting stick.What is consistent across every tab I have looked at is that
viewportSettingand the measuredviewportdisagree on tabs nobody has successfully resized. Across six sessions the stored setting was alwaysfreeform 1280x800, while the measured viewport was whatever the panel happened to be:2019x1262,1843x1152,1403x877,1402x876,889x555,1281x801.Related#
visible: truecase above suggests resize is a separate cause.