GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): preview image attachments delivered by path by opencode-agent[bot] · Pull Request #57249 · anomalyco/opencode

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

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 PNG instead. 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

  • Path attachments with an image/* MIME type now render the same thumbnail as inline images. The bytes are read through the server's fs/read (readLocalImage, the same route Markdown images use), so both local source paths and paths uploaded to a remote server work.
  • Clicking the thumbnail opens the existing image preview for both kinds of attachment.
  • If the file can't be read (for example, it was deleted), the chip falls back to the existing filename card instead of showing an empty box.
  • Object URLs are cached per path in the composer and revoked when it unmounts. Pending reads are aborted.
  • Thumbnail loading reads resource state instead of suspending, which keeps the existing focus-preserving behavior without the local Suspense.
  • readLocalImage now 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 typecheck in packages/app.
  • image.test.ts: a new backslash drive-path case, which fails before the fix.
  • The composer mixed-attachments story 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.
  • Not run on a real Windows desktop: the Windows dev box was unreachable.

Requested by: @Hona (Hona via Slack)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
fix(app): preview image attachments delivered by path
1ff8bc1
@opencode-agent
opencode-agent Bot requested review from Brendonovich and Hona as code owners October 20, 2026 01:45
@github-actions github-actions Bot added the contributor label Oct 20, 2026
@opencode-agent opencode-agent Bot assigned Hona Oct 20, 2026
@Hona
Hona merged commit fa2888b into beta Oct 20, 2026
16 of 17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the path-image-preview branch October 20, 2026 01:46
@amrkmn amrkmn mentioned this pull request Oct 27, 2026
opencode 2.2.0 amrkmn/homebrew-tap#1182
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Oct 28, 2026
Tool release: OpenCode 2 v2.2.0 (was v2.1.4) agent-sh/agnix#1737
Closed
This was referenced Oct 28, 2026
app: the attachment card in a sent message is display-only — the uploaded file cannot be opened or downloaded #59896
Open
web: historical image attachments show filename instead of thumbnail in remote sessions #61229
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Hona Hona Awaiting requested review from Hona
@Brendonovich Brendonovich Awaiting requested review from Brendonovich

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Hona Hona

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Hona
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.