Conversation
…e URLs Chat markdown historically embeds live workdir paths such as img:///a0/usr/workdir/logo.png. Reusing that filename overwrites the file, so older bubbles show the newest image after a UI reload. Missing files also returned a fallback icon with max-age=3600, so the browser could cache the icon under the PNG URL. Copy finished response image refs onto unique chat artifacts and only cache immutable chat-scoped files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1865
Problem
Chat bubbles that embed generated images via live workdir paths (
img:///a0/usr/workdir/logo.pngor/api/image_get?path=...) do not keep a historical copy. Reusing the same filename overwrites the file, so older bubbles show the newest image. Reloading the WebUI makes this ubiquitous because replay re-fetches every URL from disk.A second overlapping bug:
/api/image_getserved a generic fallback icon withCache-Control: public, max-age=3600when the file was missing. The browser could cache that icon under the PNG URL, so some bubbles failed to load even before a reload.Browser screenshots and vision-load artifacts already use unique chat-scoped names. Response-embedded workdir images did not.
Fix
img:////api/image_get?path=local image refs onto unique files underusr/chats/<id>/images/response/.no-store). Revalidate mutable workdir files (no-cache). Keepmax-age=3600only for unique chat artifacts.This is forward-looking. Already overwritten files cannot be restored from chat.json.
Tests
13 passed.
Notes
main, matching current comparable upstream PRs.