Skip to content

Displayed image is stale when underlying file is changed at the same path #12802

Closed

Description

@warp-agent-staging

Bug

When an agent displays a local image file, and the file is subsequently modified on disk, asking the agent to display the same file path again shows the original cached image instead of the updated one.

This makes it difficult to iterate on an image with the agent, because only the first version of the image is ever shown — even after the file has been overwritten.

A new file path does work correctly; the issue is specific to re-displaying a file at the same path.

Steps to reproduce

  1. Ask the agent to create an image file (e.g. a black square) and display it.
  2. Modify the file on disk (e.g. overwrite it with a white square at the same path).
  3. Ask the agent to display the same file path again.
  4. Actual: the agent displays the original (black) image from the cache.
  5. Expected: the agent displays the updated (white) image.

Workaround: copying the updated content to a new file path causes the new image to render correctly, confirming the cache is keyed by path only.

Screenshots

The first screenshot shows the reproduction: the file was changed from a black to a white square, but the second display still shows the cached black square. A copy to a new path renders correctly.

The second screenshot shows a related behaviour on session restore: after restoring, previously-displayed images appear blank/white because the cached content is gone but the path is re-used.

Internal Slack thread

https://warpdev.slack.com/archives/C08KTPNQN65/p1781712839741489

Activity

  1. warp-for-oss commented on Jun 18, 2026

    @warp-for-oss
    Contributor

    @warp-dev-github-integration[bot]

    Here's what I found while triaging this issue:

    This appears to be a reproducible cache invalidation bug: Warp can reuse the first rendered local image for a path even after the file is overwritten. Using a new filename/path is a valid workaround until the cache is refreshed or invalidated correctly.

    Maintainer details

    I concluded that agent-rendered local Markdown images can show stale content after the underlying file is overwritten at the same path because the shared asset/image caches are keyed by path and do not invalidate local-file entries on content changes..

    Triage summary

    This looks like a reproducible bug in local image rendering for agent output. The reported same-path overwrite behavior lines up with the current cache design: block-list Markdown images resolve local paths to AssetSource::LocalFile, and the shared asset/image caches key entries by that source path rather than by file content, mtime, or another versioned identifier.

    Reproducibility

    High. The report includes a minimal reproduction and a strong control case: reusing the same path shows stale content, while copying the updated image to a new path renders the new content. That matches a path-keyed cache issue.

    Likely root cause

    app/src/ai/blocklist/block/view_impl/common.rs renders supported agent Markdown image sections by resolving the image source and calling into the shared image element/cache path. crates/editor/src/content/edit.rs resolves local sources to AssetSource::LocalFile { path }. In crates/warpui_core/src/assets/asset_cache.rs, AssetCache::load_asset is explicitly idempotent for a given AssetHandle and returns the existing loaded entry once the path has been seen. crates/warpui_core/src/image_cache.rs then caches rendered images using a hash of the same AssetSource plus size/fit options.

    The result is that overwriting a local file at the same path does not cause either the decoded asset or rendered image entry to be refreshed. A likely fix is to add a local-file invalidation/versioning strategy for this rendering path, such as including observed file metadata/content identity in the asset key or evicting the relevant AssetCache/ImageCache entries when the same local image path is requested after modification.

    Duplicate check

    I scanned all open issues and recent closed issues. Related cache/memory issues exist (#9789 and #12566), but they describe unbounded image-cache growth rather than stale same-path local image content in agent output, so I am not marking this as a duplicate.

    This is my automated analysis and may be incorrect. A maintainer will verify the details.

    Powered by Oz

  2. added
    area:agent
    area:ui-framework
    bug
    repro:high
    triaged
    on Jun 18, 2026
  3. vorporeal commented on Jun 22, 2026

    @vorporeal
    Contributor

    reassigning to kevin since he's reviewing a relevant PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:agentarea:ui-frameworkbugrepro:hightriagedwarp:auto-triage-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions