We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7bf4852 + d704110 commit d9a9428Copy full SHA for d9a9428
2 files changed
packages/opencode/src/session/session.ts
@@ -301,7 +301,8 @@ export const Event = {
301
sessionID: Schema.optional(SessionID),
302
// Reuses MessageV2.Assistant.fields.error (already Schema.optional) so
303
// the derived zod keeps the same discriminated-union shape on the bus.
304
- error: MessageV2.Assistant.fields.error,
+ // Schema.suspend defers access to break circular init in compiled binaries.
305
+ error: Schema.suspend(() => MessageV2.Assistant.fields.error),
306
}),
307
),
308
}
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