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