[PR #568] [CLOSED] fix: enable image file reading in read tool (fixes #451) #9652

Closed
opened 2026-02-16 18:13:55 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/568
Author: @morgvanny
Created: 6/30/2025
Status: Closed

Base: devHead: fix-png-image-reading


📝 Commits (3)

  • b5c94b0 fix: enable image file reading in read tool (fixes #451)
  • 56bc947 feat: add server-side image processing with sharp
  • d95a56a format fixes

📊 Changes

5 files changed (+335 additions, -20 deletions)

View changed files

📝 bun.lock (+109 -19)
📝 packages/opencode/package.json (+2 -0)
📝 packages/opencode/src/tool/read.ts (+27 -1)
packages/opencode/src/util/image.ts (+68 -0)
packages/opencode/test/tool/read.test.ts (+129 -0)

📄 Description

The read tool was throwing an error for image files instead of reading them. This fix implements proper image handling by converting images to base64 data URLs, allowing opencode to read PNG, JPEG, and other image formats as documented. Should fix #451


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/568 **Author:** [@morgvanny](https://github.com/morgvanny) **Created:** 6/30/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix-png-image-reading` --- ### 📝 Commits (3) - [`b5c94b0`](https://github.com/anomalyco/opencode/commit/b5c94b08d7d92df2820c6f8ea1f05dca94070e10) fix: enable image file reading in read tool (fixes #451) - [`56bc947`](https://github.com/anomalyco/opencode/commit/56bc94762e501fe5337799ffa6fab7e0969aec68) feat: add server-side image processing with sharp - [`d95a56a`](https://github.com/anomalyco/opencode/commit/d95a56a951b8942538cc1e1d3f58bd7039c098a6) format fixes ### 📊 Changes **5 files changed** (+335 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `bun.lock` (+109 -19) 📝 `packages/opencode/package.json` (+2 -0) 📝 `packages/opencode/src/tool/read.ts` (+27 -1) ➕ `packages/opencode/src/util/image.ts` (+68 -0) ➕ `packages/opencode/test/tool/read.test.ts` (+129 -0) </details> ### 📄 Description The read tool was throwing an error for image files instead of reading them. This fix implements proper image handling by converting images to base64 data URLs, allowing opencode to read PNG, JPEG, and other image formats as documented. Should fix #451 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:55 -05:00
yindo closed this issue 2026-02-16 18:13:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9652