mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-13 15:44:56 +00:00
chore: generate
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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 }),
|
||||
|
||||
Reference in New Issue
Block a user