Note
Grok responding on behalf of Julius.
Triage
Thanks for the write-up, @btsouth, and for linking the two closed PRs, which give useful context.
What I found
Confirmed on main at 4ee6bfd50e.
- Chat reuses a cached URL. Chat embeds a local image as a
media-fileresource and renders whateveruseAssetUrlStatealready has (ChatMarkdownAssetImageinapps/web/src/components/ChatMarkdown.tsx). That cache is keyed by the resource, not by the file's contents.- While the thread stays open, the signed URL refreshes every 30 minutes.
- A new subscriber doesn't refetch during the 5-minute stale window.
- An unused entry lives for an hour.
- The timings are set in
packages/client-runtime/src/state/assets.ts, and mobile uses the same hook.
- The token doesn't track content. The signed claims are path, device, and inode, plus a one-hour expiry (
finalizeAbsoluteMediaFileAssetinapps/server/src/assets/AssetAccess.ts). Overwriting a file in place keeps its inode, and the token carries no mtime or size. The old pixels come from reusing the URL. - Images are cacheable, unlike other media. Images get
Cache-Control: private, max-age=3600(assetResponseHeadersinapps/server/src/http.ts), while audio and video are rewritten toprivate, no-storeinassetFileResponse. - Why the files panel shows the right image.
WorkspaceImagePreviewsigns aworkspace-fileURL with aworkspace-revisiontaken from the latest file change, command, or checkpoint (FilePreviewPanel.tsx,workspaceMutationIdinChatView.tsx). That skips both caches, and reloading has the same effect, which matches your workaround. - Files outside the project. Absolute paths like
/tmp/chart.pngstill go stale in chat, but the files panel only resolves files inside the workspace root.
Likely fix area
The options line up with the ones you listed. Picking one is a decision about what an image path in a message should mean over time:
- Revalidate like audio and video, using
no-store, orno-cachewith an mtime/size validator, and don't reuse a cached URL for a new message. This is a small change, but older messages would also show the newest file once their cached copy expires. - Snapshot the image when the message is written, as in #14009. This keeps history but adds storage and retention.
- Have agents use a new file name for each revision, as in #13942. This avoids the cache but doesn't fix a reused path.
A maintainer will decide on the fix direction.