Repository navigation
fix(app): preview image attachments delivered by path - #57249
Merged
Merged
Conversation
opencode-agent
Bot
requested review from
Brendonovich and
Hona
as code owners
October 20, 2026 01:45
1 task
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.
Problem
The composer only shows a thumbnail for images whose bytes are in the draft store. An image attached as a path attachment shows a text card with the filename and
PNGinstead. That happens when the image is a file the server reads by path rather than inline: it is too large to send inline, the selected model has no image input, or the composer had no resolved model when the file was added.Fix
image/*MIME type now render the same thumbnail as inline images. The bytes are read through the server'sfs/read(readLocalImage, the same route Markdown images use), so both local source paths and paths uploaded to a remote server work.Suspense.readLocalImagenow accepts Windows drive paths that use backslashes (C:\Users\...\image.png). Previously it rejected them as a URL scheme, so a file reference on Windows couldn't load.Verification
bun run typecheckinpackages/app.image.test.ts: a new backslash drive-path case, which fails before the fix.mixed-attachmentsstory now includes a path image attachment, and its existing component test asserts the thumbnail renders. That assertion fails before the editor change. I checked it against Storybook in Chromium; the full Playwright component harness couldn't launch a browser on my host.Requested by: @Hona (Hona via Slack)