fix(read): prevent unsupported image formats from being sending to provider (#21114)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
Zeke Sikelianos
2026-05-01 16:14:22 -07:00
committed by GitHub
parent 478156456e
commit 51e310c9ce
2 changed files with 23 additions and 2 deletions

View File

@@ -440,6 +440,24 @@ root_type Monster;`
expect(result.output).toContain("table Monster")
}),
)
it.live("falls through unsupported image mime types to text", () =>
Effect.gen(function* () {
const dir = yield* tmpdirScoped()
const cases = [
["image.bmp", "BM text content"],
["photo.tiff", "II text content"],
["photo.avif", "avif text content"],
] as const
for (const item of cases) {
yield* put(path.join(dir, item[0]), item[1])
const result = yield* exec(dir, { filePath: path.join(dir, item[0]) })
expect(result.attachments).toBeUndefined()
expect(result.output).toContain(item[1])
}
}),
)
})
describe("tool.read loaded instructions", () => {