We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b070652 + d704110 commit c633ea7Copy full SHA for c633ea7
2 files changed
packages/opencode/src/session/session.ts
@@ -316,7 +316,8 @@ export const Event = {
316
sessionID: Schema.optional(SessionID),
317
// Reuses MessageV2.Assistant.fields.error (already Schema.optional) so
318
// the derived zod keeps the same discriminated-union shape on the bus.
319
- error: MessageV2.Assistant.fields.error,
+ // Schema.suspend defers access to break circular init in compiled binaries.
320
+ error: Schema.suspend(() => MessageV2.Assistant.fields.error),
321
}),
322
),
323
}
packages/opencode/src/util/effect-zod.ts
@@ -256,6 +256,8 @@ function body(ast: SchemaAST.AST): z.ZodTypeAny {
256
return array(ast)
257
case "Declaration":
258
return decl(ast)
259
+ case "Suspend":
260
+ return z.lazy(() => walk(ast.thunk()))
261
default:
262
return fail(ast)
263
0 commit comments