Ver código fonte

chore: generate

opencode-agent[bot] 1 mês atrás
pai
commit
0e2dd4ad15

+ 2 - 1
packages/core/src/tool/read.ts

@@ -75,7 +75,8 @@ export const layer = Layer.effectDiscard(
                 agent: context.agent,
                 source,
               })
-              if (type === "directory") return yield* reader.list(absolute, { offset: input.offset, limit: input.limit })
+              if (type === "directory")
+                return yield* reader.list(absolute, { offset: input.offset, limit: input.limit })
               const content = yield* reader.read(absolute, resource, {
                 offset: input.offset,
                 limit: input.limit,

+ 1 - 3
packages/core/test/tool-read.test.ts

@@ -223,9 +223,7 @@ describe("ReadTool", () => {
         },
         { sessionID, action: "read", resources: [external.replaceAll("\\", "/")], save: ["*"] },
       ])
-      expect(readCalls).toEqual([
-        { input: AbsolutePath.make(external), page: { offset: undefined, limit: undefined } },
-      ])
+      expect(readCalls).toEqual([{ input: AbsolutePath.make(external), page: { offset: undefined, limit: undefined } }])
     }),
   )