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 10e340d7f8f..d760bba414c 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1841,8 +1841,9 @@ function Question(props: ToolProps) { const { theme } = useTheme() const count = createMemo(() => props.input.questions?.length ?? 0) - function format(answer?: string[]) { + function format(answer?: string[] | string) { if (!answer?.length) return "(no answer)" + if (!Array.isArray(answer)) return String(answer) return answer.join(", ") } diff --git a/packages/opencode/src/tool/question.ts b/packages/opencode/src/tool/question.ts index c6f0b91599b..9e680b42258 100644 --- a/packages/opencode/src/tool/question.ts +++ b/packages/opencode/src/tool/question.ts @@ -15,8 +15,9 @@ export const QuestionTool = Tool.define("question", { tool: ctx.callID ? { messageID: ctx.messageID, callID: ctx.callID } : undefined, }) - function format(answer: Question.Answer | undefined) { + function format(answer: Question.Answer | string | undefined) { if (!answer?.length) return "Unanswered" + if (!Array.isArray(answer)) return String(answer) return answer.join(", ") }