Skip to content

The open source coding agent.

TypeScript

fix: read when file is svg

Aiden Cline84a0868e66e1
diff --git a/packages/opencode/src/tool/read.ts b/packages/opencode/src/tool/read.ts
index e1ba8452450..27426ad2412 100644
--- a/packages/opencode/src/tool/read.ts
+++ b/packages/opencode/src/tool/read.ts
@@ -93,7 +93,7 @@ export const ReadTool = Tool.define("read", {
throw new Error(`File not found: ${filepath}`)
}
- const isImage = file.type.startsWith("image/")
+ const isImage = file.type.startsWith("image/") && file.type !== "image/svg+xml"
const isPdf = file.type === "application/pdf"
if (isImage || isPdf) {
const mime = file.type