Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit d5f0e3f

Browse files
committed
test: add larger image test for read tool
1 parent 7d2bb5c commit d5f0e3f

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

2.56 MB
Loading

packages/opencode/test/tool/read.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,18 @@ describe("tool.read truncation", () => {
286286
},
287287
})
288288
})
289+
290+
test("large image files are properly attached without error", async () => {
291+
await Instance.provide({
292+
directory: FIXTURES_DIR,
293+
fn: async () => {
294+
const read = await ReadTool.init()
295+
const result = await read.execute({ filePath: path.join(FIXTURES_DIR, "large-image.png") }, ctx)
296+
expect(result.metadata.truncated).toBe(false)
297+
expect(result.attachments).toBeDefined()
298+
expect(result.attachments?.length).toBe(1)
299+
expect(result.attachments?.[0].type).toBe("file")
300+
},
301+
})
302+
})
289303
})

0 commit comments

Comments
 (0)