From 0f86a4ebfed0433f98b879b19714b215eab17625 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Mon, 13 Apr 2026 21:20:00 -0400 Subject: [PATCH] use Schema.Class for question payloads Align the experimental question API schemas with the repo's Effect modeling style and keep the TUI answer rendering compatible with readonly arrays. --- .../src/cli/cmd/tui/routes/session/index.tsx | 2 +- packages/opencode/src/question/index.ts | 58 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index c6bc231fca..c7790006f4 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -2195,7 +2195,7 @@ function Question(props: ToolProps) { const { theme } = useTheme() const count = createMemo(() => props.input.questions?.length ?? 0) - function format(answer?: string[]) { + function format(answer?: ReadonlyArray) { if (!answer?.length) return "(no answer)" return answer.join(", ") } diff --git a/packages/opencode/src/question/index.ts b/packages/opencode/src/question/index.ts index f409ed8bb4..2373e8c416 100644 --- a/packages/opencode/src/question/index.ts +++ b/packages/opencode/src/question/index.ts @@ -12,16 +12,16 @@ export namespace Question { // Schemas - const _Option = Schema.Struct({ + export class Option extends Schema.Class