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:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user