Jelajahi Sumber

chore: generate

opencode-agent[bot] 5 bulan lalu
induk
melakukan
854484babf

+ 2 - 1
packages/opencode/src/effect/cross-spawn-spawner.ts

@@ -497,5 +497,6 @@ const rt = lazy(() => {
   return makeRuntime(ChildProcessSpawner, defaultLayer)
 })
 
-export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) => rt().runPromiseExit(...(args as [any]))
+export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) =>
+  rt().runPromiseExit(...(args as [any]))
 export const runPromise: ReturnType<typeof rt>["runPromise"] = (...args) => rt().runPromise(...(args as [any]))

+ 0 - 1
packages/opencode/src/session/message-v2.ts

@@ -900,7 +900,6 @@ export namespace MessageV2 {
     }
   }
 
-
   export function filterCompacted(msgs: Iterable<MessageV2.WithParts>) {
     const result = [] as MessageV2.WithParts[]
     const completed = new Set<string>()

+ 12 - 20
packages/opencode/src/tool/bash.ts

@@ -314,7 +314,6 @@ function cmd(shell: string, name: string, command: string, cwd: string, env: Nod
   })
 }
 
-
 async function run(
   input: {
     shell: string
@@ -340,23 +339,19 @@ async function run(
 
   const exit = await CrossSpawnSpawner.runPromiseExit((spawner) =>
     Effect.gen(function* () {
-      const handle = yield* spawner.spawn(
-        cmd(input.shell, input.name, input.command, input.cwd, input.env),
-      )
+      const handle = yield* spawner.spawn(cmd(input.shell, input.name, input.command, input.cwd, input.env))
 
       yield* Effect.forkScoped(
-        Stream.runForEach(
-          Stream.decodeText(handle.all),
-          (chunk) =>
-            Effect.sync(() => {
-              output += chunk
-              ctx.metadata({
-                metadata: {
-                  output: preview(output),
-                  description: input.description,
-                },
-              })
-            }),
+        Stream.runForEach(Stream.decodeText(handle.all), (chunk) =>
+          Effect.sync(() => {
+            output += chunk
+            ctx.metadata({
+              metadata: {
+                output: preview(output),
+                description: input.description,
+              },
+            })
+          }),
         ),
       )
 
@@ -385,10 +380,7 @@ async function run(
       }
 
       return exit.kind === "exit" ? exit.code : null
-    }).pipe(
-      Effect.scoped,
-      Effect.orDie,
-    ),
+    }).pipe(Effect.scoped, Effect.orDie),
   )
 
   let code: number | null = null

+ 4 - 1
packages/opencode/test/session/messages-pagination.test.ts

@@ -722,7 +722,10 @@ describe("MessageV2.filterCompacted", () => {
         const u1 = await addUser(session.id, "hello")
         await addCompactionPart(session.id, u1)
 
-        const error = new MessageV2.APIError({ message: "boom", isRetryable: true }).toObject() as MessageV2.Assistant["error"]
+        const error = new MessageV2.APIError({
+          message: "boom",
+          isRetryable: true,
+        }).toObject() as MessageV2.Assistant["error"]
         await addAssistant(session.id, u1, { summary: true, finish: "end_turn", error })
         const u2 = await addUser(session.id, "retry")