opencode-agent[bot] 3 месяцев назад
Родитель
Сommit
e46ab34d27

+ 2 - 1
packages/opencode/src/acp/agent.ts

@@ -1328,7 +1328,8 @@ export class Agent implements ACPAgent {
     if (!current) {
       this.sessionManager.setModel(session.id, model)
     }
-    const agent = session.modeId ?? (await AppRuntime.runPromise(AgentModule.Service.use((svc) => svc.defaultInfo()))).name
+    const agent =
+      session.modeId ?? (await AppRuntime.runPromise(AgentModule.Service.use((svc) => svc.defaultInfo()))).name
 
     const parts: Array<
       | { type: "text"; text: string; synthetic?: boolean; ignored?: boolean }

+ 3 - 1
packages/opencode/test/plugin/loader-shared.test.ts

@@ -845,7 +845,9 @@ describe("plugin.loader.shared", () => {
       (tmp) =>
         Effect.gen(function* () {
           yield* load(tmp.path)
-          expect(yield* Effect.promise(() => Filesystem.readJson<{ source: string; enabled: boolean }>(tmp.extra.mark))).toEqual({
+          expect(
+            yield* Effect.promise(() => Filesystem.readJson<{ source: string; enabled: boolean }>(tmp.extra.mark)),
+          ).toEqual({
             source: "tuple",
             enabled: true,
           })

+ 13 - 11
packages/opencode/test/project/instance.test.ts

@@ -220,17 +220,19 @@ describe("InstanceStore", () => {
     }),
   )
 
-  it.instance("provides legacy Promise callers with instance ALS", () =>
-    Effect.gen(function* () {
-      const test = yield* TestInstance
-      const ctx = yield* InstanceRef
-      if (!ctx) throw new Error("InstanceRef not provided")
-
-      const directory = yield* Effect.promise(() => Promise.resolve(Instance.restore(ctx, () => Instance.directory)))
-
-      expect(directory).toBe(test.directory)
-      expect(() => Instance.current).toThrow()
-    }),
+  it.instance(
+    "provides legacy Promise callers with instance ALS",
+    () =>
+      Effect.gen(function* () {
+        const test = yield* TestInstance
+        const ctx = yield* InstanceRef
+        if (!ctx) throw new Error("InstanceRef not provided")
+
+        const directory = yield* Effect.promise(() => Promise.resolve(Instance.restore(ctx, () => Instance.directory)))
+
+        expect(directory).toBe(test.directory)
+        expect(() => Instance.current).toThrow()
+      }),
     { git: true },
   )
 })

+ 3 - 1
packages/opencode/test/skill/discovery.test.ts

@@ -101,7 +101,9 @@ describe("Discovery.pull", () => {
         const refs = path.join(agentsSdk, "references")
         expect(yield* Effect.promise(() => Filesystem.exists(path.join(agentsSdk, "SKILL.md")))).toBe(true)
         // agents-sdk has reference files per the index
-        const refDir = yield* Effect.promise(() => Array.fromAsync(new Bun.Glob("**/*.md").scan({ cwd: refs, onlyFiles: true })))
+        const refDir = yield* Effect.promise(() =>
+          Array.fromAsync(new Bun.Glob("**/*.md").scan({ cwd: refs, onlyFiles: true })),
+        )
         expect(refDir.length).toBeGreaterThan(0)
       }
     }),