Explorar el Código

test: add larger image test for read tool

Aiden Cline hace 1 mes
padre
commit
d5f0e3fccc

BIN
packages/opencode/test/tool/fixtures/large-image.png


+ 14 - 0
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")
+      },
+    })
+  })
 })