Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- In a thread, open a local workspace HTML file (for example
report.html, which may reference sibling.css/.js/images) in the built-in browser preview. - Change the file on disk (edit it yourself, or have the agent rewrite it).
- Look at the preview tab, then press the preview's Refresh button (or ⌘R).
- Close the preview tab and open the same file again.
Expected behavior
After the file changes, the preview shows the current version. At the latest, Refresh shows the new content. Ideally the preview reloads by itself when the opened file (or a file it loaded) changes on disk, the way a dev server's live reload works.
Actual behavior
- The preview does not update by itself when the file changes.
- Refresh / ⌘R keeps showing the old content.
- Only closing the tab and opening the file again shows the new version.
From reading the 0.1.13-nightly bundle, this looks like the cause:
- Workspace files are served through the signed
/api/assets/*route, andassetResponseHeaders()(and thebytesbranch oflayerAssetRoute) setCache-Control: private, max-age=3600. - The preview's Refresh and its refresh shortcut call
webContents.reload(), notreloadIgnoringCache(), so the cached copies of the page's resources are used for up to an hour. - Opening the file again issues a new signed URL (new token), which the browser treats as a new resource, so that path is the only one that shows the current file.
- I found no file watcher that reloads a preview tab when its entry file or the files it requested (
entryFileNameis already tracked in the asset claims) change.
Related: #15739 (stale content in the Files panel). That one covered text and image tabs. This one is about HTML in the browser preview.
Impact
Major degradation or frequent failure
Iterating on agent-generated HTML (reports, charts, mockups) is a core loop. Every edit needs the tab closed and reopened. Refresh looks like it worked but still shows the old version, so it's easy to review a stale page by mistake.
Version or commit
T3 Code (Nightly) 0.1.13-nightly.20261126.5305
Environment
macOS 27.3, desktop app, local environment
Logs or stack traces
N/A
Workaround
Close the preview tab and open the file again. Or serve the folder from a local dev server with live reload and open the localhost URL in the preview.
Suggested fix
- Serve
workspace-file/workspace-file-exactassets withCache-Control: no-cache(orno-store), or add anETag/Last-Modifiedbased on the file's mtime and size, so a normal reload revalidates. - Optionally make the preview Refresh use
reloadIgnoringCache()for workspace-file pages. - Optionally watch the entry file and its tracked dependencies, and auto-reload the tab when they change.
Activity