You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SDK cannot handle question tool interaction (no way to respond to tool calls in serve mode) #19702
Question tool hangs in ACP mode #17920: Same hanging behavior with the question tool, in ACP mode — same root cause (no handler forwards question.asked events to external clients)
If your issue is not covered by either of those, please add clarifying details to differentiate.
import { tool } from "@opencode-ai/plugin"
export const ask_user = tool({
description:
"Ask the user a question with multiple-choice options. " +
"This tool returns IMMEDIATELY — it does NOT block or wait for the answer. " +
"The playground UI will show an interactive selection banner. " +
"The user's answer will arrive as the next message in the conversation. " +
"After calling this tool, STOP and wait for the user's reply before continuing.",
args: {
questions: tool.schema
.array(
tool.schema.object({
id: tool.schema.string().describe("Unique question identifier"),
prompt: tool.schema
.string()
.describe("The question text to display"),
options: tool.schema
.array(
tool.schema.object({
id: tool.schema.string().describe("Option identifier"),
label: tool.schema.string().describe("Option display text"),
}),
)
.describe("List of choices the user can pick from"),
allow_multiple: tool.schema
.boolean()
.optional()
.describe("If true, user can select multiple options"),
}),
)
.describe("One or more questions to ask the user"),
},
async execute(args) {
const summary = args.questions
.map((q) => `${q.prompt} (${q.options.length} options)`)
.join("; ")
return `Asked the user: ${summary}. Waiting for their reply in the next message.`
},
})
Corroborating evidence from direct runtime introspection (OpenCode 1.18.15): ctx.client.question is undefined inside a plugin, and ctx.client.session's actual prototype methods are:
— nothing question-related. Confirmed via Object.getOwnPropertyNames(Object.getPrototypeOf(ctx.client.session)), not just docs/types.
As a stopgap for anyone hitting this in the meantime: we built a polling-based workaround (not a real fix, just documenting the pattern in case it helps someone before a real API ships) that watches session.list() + session.messages() for a session whose trailing message part is a still-pending question tool call, and after a configurable timeout calls session.abort() + session.prompt() to unstick the session with a "proceed with your best judgement" instruction — since there's no way to actually answer the question object itself through the plugin SDK today.
Activity
github-actions commentedon Mar 29, 2026
This issue might be a duplicate of existing issues. Please check:
Question.askfor API/SDK — directly addresses the same missing SDK functionality you're describingquestiontool, in ACP mode — same root cause (no handler forwardsquestion.askedevents to external clients)If your issue is not covered by either of those, please add clarifying details to differentiate.
theredbluepill commentedon Apr 15, 2026
This issue is indeed so annoying..
theredbluepill commentedon Apr 15, 2026
Can try custom tool:
rekram1-node commentedon Jun 23, 2026
Automated: closing question issues.
GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.
If this is a bug or feature request, please open a new issue with the appropriate template.
rekram1-node commentedon Jun 23, 2026
Reopening – this was incorrectly closed by automated question-issue cleanup. Sorry for the noise.
sergiofspedro commentedon Aug 9, 2026
Corroborating evidence from direct runtime introspection (OpenCode 1.18.15):
ctx.client.questionisundefinedinside a plugin, andctx.client.session's actual prototype methods are:— nothing question-related. Confirmed via
Object.getOwnPropertyNames(Object.getPrototypeOf(ctx.client.session)), not just docs/types.As a stopgap for anyone hitting this in the meantime: we built a polling-based workaround (not a real fix, just documenting the pattern in case it helps someone before a real API ships) that watches
session.list()+session.messages()for a session whose trailing message part is a still-pendingquestiontool call, and after a configurable timeout callssession.abort()+session.prompt()to unstick the session with a "proceed with your best judgement" instruction — since there's no way to actually answer the question object itself through the plugin SDK today.github-actions commentedon Oct 10, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.