The open source coding agent.
TypeScript
test: add larger image test for read tool
Aiden Clined5f0e3fcccdf
diff --git a/packages/opencode/test/tool/fixtures/large-image.png b/packages/opencode/test/tool/fixtures/large-image.pngnew file mode 100644index 00000000000..8a1ead1f711Binary files /dev/null and b/packages/opencode/test/tool/fixtures/large-image.png differdiff --git a/packages/opencode/test/tool/read.test.ts b/packages/opencode/test/tool/read.test.tsindex a88d25f73ab..1a08b15b4a8 100644--- a/packages/opencode/test/tool/read.test.ts+++ b/packages/opencode/test/tool/read.test.ts@@ -286,4 +286,18 @@ describe("tool.read truncation", () => {},})})++ test("large image files are properly attached without error", async () => {+ await Instance.provide({+ directory: FIXTURES_DIR,+ fn: async () => {+ const read = await ReadTool.init()+ const result = await read.execute({ filePath: path.join(FIXTURES_DIR, "large-image.png") }, ctx)+ expect(result.metadata.truncated).toBe(false)+ expect(result.attachments).toBeDefined()+ expect(result.attachments?.length).toBe(1)+ expect(result.attachments?.[0].type).toBe("file")+ },+ })+ })})