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

+ 1 - 3
packages/opencode/src/cli/cmd/tui/context/sync.tsx

@@ -406,9 +406,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
           // Surface every failed endpoint in one labeled message instead of
           // letting the first rejection drown its siblings as unhandled
           // rejections.
-          const failure = aggregateFailures(
-            blockingRequests.map((r, i) => ({ name: r.name, result: settled[i] })),
-          )
+          const failure = aggregateFailures(blockingRequests.map((r, i) => ({ name: r.name, result: settled[i] })))
           if (failure) throw failure
         })
         .then(async () => {

+ 2 - 6
packages/opencode/test/cli/cmd/tui/aggregate-failures.test.ts

@@ -43,17 +43,13 @@ describe("aggregateFailures", () => {
 
   test("attaches structured failure list under .cause", () => {
     const reason = new Error("nope")
-    const err = aggregateFailures([
-      { name: "providers", result: { status: "rejected", reason } },
-    ])
+    const err = aggregateFailures([{ name: "providers", result: { status: "rejected", reason } }])
     const cause = err!.cause as { failures: Array<{ name: string; reason: unknown }> }
     expect(cause.failures).toEqual([{ name: "providers", reason }])
   })
 
   test("falls back to String() for opaque reasons", () => {
-    const err = aggregateFailures([
-      { name: "x", result: { status: "rejected", reason: 42 } },
-    ])
+    const err = aggregateFailures([{ name: "x", result: { status: "rejected", reason: 42 } }])
     expect(err!.message).toContain("x: 42")
   })
 })

+ 1 - 3
packages/opencode/test/server/httpapi-promptasync-context.test.ts

@@ -79,9 +79,7 @@ const setupWorkspace = (kind: string) =>
   Effect.gen(function* () {
     const dir = yield* tmpdirScoped({ git: true })
     yield* Project.use.fromDirectory(dir)
-    const projectID = yield* Project.Service.use((svc) =>
-      svc.fromDirectory(dir).pipe(Effect.map((p) => p.project.id)),
-    )
+    const projectID = yield* Project.Service.use((svc) => svc.fromDirectory(dir).pipe(Effect.map((p) => p.project.id)))
     registerAdapter(projectID, kind, localAdapter(dir))
     const workspace = yield* Workspace.Service.use((svc) =>
       svc.create({ type: kind, branch: null, extra: null, projectID }),