We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5cd178b commit d704110Copy full SHA for d704110
2 files changed
packages/opencode/src/session/session.ts
@@ -284,7 +284,8 @@ export const Event = {
284
sessionID: Schema.optional(SessionID),
285
// Reuses MessageV2.Assistant.fields.error (already Schema.optional) so
286
// the derived zod keeps the same discriminated-union shape on the bus.
287
- error: MessageV2.Assistant.fields.error,
+ // Schema.suspend defers access to break circular init in compiled binaries.
288
+ error: Schema.suspend(() => MessageV2.Assistant.fields.error),
289
}),
290
),
291
}
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