Repository navigation
[Bug]: Remote PDF previews start a download instead of rendering after server-browser switch #16853
Copy link
Copy link
Closed
Labels
bugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
Description
Activity
Note
Grok responding on behalf of Julius.
Thanks for the detailed report. The regression checks out against current
main.Root cause
openUrlInPreviewtreats.pdfas a preview file and passesruntime: "server"whenever the environment supports the server browser (openFileInPreview.ts#L29-L30, #L62-L73, previewRuntime.ts#L12-L14).- The desktop only draws a server tab natively for its own primary environment. Remote environments stream the server tab (previewRuntime.ts#L31-L42), so for remote environments a PDF never reaches a local renderer.
- Server tabs run the pinned Chrome for Testing headless shell (PreviewBrowser.ts#L24-L31), launched with
headless: true(ServerBrowserContexts.ts#L39-L48). That shell has no PDF viewer, soapplication/pdfbecomes a download andpage.gotorejects.
How the failure is handled today
- The
downloadevent is saved on the server and offered to the tab's controlling viewer as a "Downloaded …" toast (ServerBrowser.ts#L821, #L857-L885, ServerBrowserSurface.tsx#L126-L137). If no controller is attached when the download finishes, nothing is offered. I haven't confirmed whether that happens on first open from a chat link. - The initial
gotoerror on tab creation is swallowed (ServerBrowser.ts#L839-L845). The tab is left with no rendered document and no explanation. - Automation navigation only rewrites
ERR_*errors. "Download is starting" is rethrown raw (ServerBrowser.ts#L1175-L1197), which matches thepreview_navigatefailure you saw.
Minimal fix
Treat a main-frame navigation that turns into a download as a distinct outcome. Report a clear "this file can't be shown here" state in the tab, with Open externally / Download actions that use the existing download route. Return a typed error from automationnavigateinstead of the raw Playwright message. Make sure the offer still reaches the viewer when the download finishes before a controller attaches.Larger options (design call)
- Render PDFs in the server tab with a bundled viewer such as PDF.js.
- Route PDF/file previews for remote environments to a local render: the client fetches the signed asset URL and shows it in its own viewer. This overlaps with the open local-render discussion in [Bug]: Server-side browser makes previews blurry, with no way to opt out #16578 / [Bug]: Streamed server-browser previews are high-latency and CPU-heavy on remote GPU-less hosts, with no local-render path #16827.
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Oct 7, 2026
Metadata
Metadata
Assignees
Labels
bugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
Before submitting
Area
apps/server (preview), apps/web, apps/desktop
Summary
PDF links from a remote environment no longer display in the integrated browser of the macOS desktop client after the environment-hosted browser change in #15328. The PDF is served successfully, but the server browser starts a download instead of rendering it. T3 preview automation reports
page.goto: Download is starting.The user reports that this workflow previously worked. The current failure was reproduced independently through the T3 preview tools; an old-release A/B test has not been performed.
Steps to reproduce
[Report](/absolute/workspace/docs/report.pdf).preview_open, then callpreview_navigatewith the PDF's fresh signed/api/assets/<redacted>/report.pdfURL.Expected behavior
The PDF renders inside T3 as it did before the change. If the selected browser cannot render PDFs, T3 should offer a working document viewer or an explicit external-open/download fallback instead of treating the document as a navigable page that fails to load.
Actual behavior
The macOS client does not show the linked PDF. In the server-browser reproduction, both HTTP LAN and HTTPS asset URLs fail navigation with:
Evaluating the active server browser returns:
{ "pdfViewerEnabled": false, "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/154.0.8037.92 Safari/537.36" }Independent GET requests through LAN, loopback, and HTTPS all return
200,Content-Type: application/pdf,Content-Length: 1559562, and bytes starting with%PDF-1.4. The file exists and the signed URL was unexpired during reproduction. This is not specific to the LAN route.Regression investigation
#15328 merged on 2026-10-06 at 15:04:28 UTC, as
ac8e9453ca0948469ccf5651b765086d8d9ecd64.openFileInPreview.tsnow passes the runtime selected bypreviewRuntimeForwhen opening file/URL previews.previewRuntime.tsselectsserverfor environments supporting the server browser. Native desktop rendering is restricted to the desktop's own primary environment; remote environments stream the server tab.PreviewBrowser.tsinstalls Chrome for Testing headless shell, shared by server-browser tabs and HTML rendering.ServerBrowserContexts.tslaunches it withheadless: true.This strongly points to the browser-runtime switch exposing the shell's unavailable PDF viewer, rather than an intentional PDF-disable setting. Current
main(611132c171, checked 2026-10-07) retains this path; no specific fix was found. The live failure was reproduced on the installed nightly, not by building main.Impact
Major degradation or frequent failure: generated study/report PDFs cannot be viewed in the remote integrated browser.
Version or commit
Server/web deployment reports
0.0.46-nightly.20261007.2774. Source reviewed:main @ 611132c171f3a821bd2e32f22261135cef6330ac.Environment
Client: macOS T3 desktop app connected to a separate environment (exact desktop version not collected).
Server: Linux x64, systemd user service, Chrome for Testing headless shell
154.0.8037.92.Routes tested: direct trusted-LAN HTTP, loopback HTTP, and existing reverse-proxy HTTPS. No credentials or signed asset tokens included.
Related reports
Workaround / possible fix
The asset itself remains retrievable: open its fresh signed URL in an external PDF-capable browser, or download it and use a native PDF reader.
Possible fix directions: render PDFs through a dedicated viewer such as PDF.js, or keep a PDF-capable client rendering path for remote desktop tabs. At minimum, handle download-start navigation explicitly with a usable fallback. Merely switching LAN HTTP to HTTPS does not fix this reproduction.
Generated with GPT-6.1-Sol. Harness: Codex through T3 Code.