From a70132a7f3676f8849e588e78b58d382ab1c1883 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 8 Jan 2026 17:29:11 -0500 Subject: [PATCH] fix(question): include option descriptions in tool output --- packages/opencode/src/tool/question.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/tool/question.ts b/packages/opencode/src/tool/question.ts index c6f0b91599..a4b65edd69 100644 --- a/packages/opencode/src/tool/question.ts +++ b/packages/opencode/src/tool/question.ts @@ -15,12 +15,18 @@ export const QuestionTool = Tool.define("question", { tool: ctx.callID ? { messageID: ctx.messageID, callID: ctx.callID } : undefined, }) - function format(answer: Question.Answer | undefined) { + function format(q: Question.Info, answer: Question.Answer | undefined) { if (!answer?.length) return "Unanswered" - return answer.join(", ") + return answer + .map((label) => { + const opt = q.options.find((x) => x.label === label) + if (!opt) return label + return `${opt.label} - ${opt.description}` + }) + .join(", ") } - const formatted = params.questions.map((q, i) => `"${q.question}"="${format(answers[i])}"`).join(", ") + const formatted = params.questions.map((q, i) => `"${q.question}"="${format(q, answers[i])}"`).join(", ") return { title: `Asked ${params.questions.length} question${params.questions.length > 1 ? "s" : ""}`,