Skip to content

ACP (OpenCode): AskUserQuestion tool call times out after 60s, answer is lost #1944

Closed

Description

@SawyerHood

Summary

With an ACP provider such as OpenCode, the AskUserQuestion tool shows the question card in bb, but the agent gets a tool error after 60 seconds. The agent then reports that the user did not answer and continues with its own choice. When the user submits the card later, the answer goes nowhere.

Reported on Discord ("Ask mode in OpenCode times out", 2026-08-18) for OpenCode and for a custom Kimi provider plugin.

Versions and environment

  • bb 0.38.0 and main at 15db360
  • Linux, Node v24.18.0
  • Provider: ACP (provider-acp) with OpenCode. OpenCode uses the MCP TypeScript SDK client (@modelcontextprotocol/sdk).

Steps to reproduce

  1. Start a thread with OpenCode through the ACP provider.
  2. Send: Use the AskUserQuestion tool to ask me which database to use: SQLite or Postgres. Wait for my answer.
  3. Wait more than 60 seconds before you answer the card.
  4. Answer the card.

Faithful unit repro at the exact code path: plugins/provider-acp/src/bridge/tool-proxy-mcp.test.ts (added in the fix PR). It drives the bb-bridge MCP server with the real MCP SDK client the way OpenCode does (resetTimeoutOnProgress: true, onprogress, short timeout) and delays the bridge answer past the timeout.

Expected vs actual

Expected: the tool call stays open until the user answers, and the agent reads the answers.

Actual (MCP client side, from the unit repro; OpenCode shows the same error after 60 s):

McpError: MCP error -32001: Request timed out
 ❯ Timeout.timeoutHandler node_modules/@modelcontextprotocol/sdk/src/shared/protocol.ts:1216:57

The agent then continues as if the user did not answer. The bb card stays pending for its own 10 minute budget, and the later answer is dropped.

Evidence

Root cause: the MCP SDK client default request timeout is 60 s (DEFAULT_REQUEST_TIMEOUT_MSEC = 60000 in @modelcontextprotocol/sdk/shared/protocol.js). OpenCode calls client.callTool(..., { resetTimeoutOnProgress: true, onprogress: () => {} }) (opencode mcp/catalog.ts), so the SDK attaches a _meta.progressToken and resets the timer on each notifications/progress from the server.

The bb-bridge MCP server never sends progress notifications. tools/call blocks on the TCP round trip to the bridge and the runtime until the plugin tool returns:

return;
case "tools/call": {
const params = objectParams(message.params);
const name = typeof params.name === "string" ? params.name : "";
const tool = env.tools.find((candidate) => candidate.name === name);
if (!tool) {
writeError(message.id, -32602, `Unknown tool: ${name}`);
return;
}
const rawArguments = params.arguments;
const toolArguments =
rawArguments &&
typeof rawArguments === "object" &&
!Array.isArray(rawArguments)
? (rawArguments as Record<string, unknown>)
: {};
try {
const result = await callBridge(env, {
arguments: toolArguments,
callId: mcpToolCallId(tool.name),
tool: tool.name,
});
if (!result.ok) {
writeResult(message.id, {
content: [{ type: "text", text: result.error }],
isError: true,
});
return;
}
writeResult(message.id, {
content: [{ type: "text", text: result.content }],
...(result.isError ? { isError: true } : {}),
});
} catch (error) {
writeResult(message.id, {
content: [
{
type: "text",
text: error instanceof Error ? error.message : String(error),
},
],
isError: true,

AskUserQuestion waits on bb.ui.requestInput with a 10 minute default, so any answer slower than 60 s is lost:

);
}
const askedAt = Date.now();
let result;
try {
result = await bb.ui.requestInput(
{
threadId: ctx.threadId,
rendererId: RENDERER_ID,
title: buildInteractionTitle(payload),
payload,
},
{ signal: ctx.signal },
);
} catch (error) {
// A thread holds at most one interaction at a time, so two questions
// issued as parallel tool calls race and the loser lands here. Say so
// plainly: the model can put every question in one call instead.

What you ruled out

  • Not a duplicate of AskUserQuestion multi-question submission can resolve without returning answers #1082: that one was a bb Connect 504 on the server route and is fixed by the streaming response head.
  • No timeout exists on the bb side of the path (forwardDynamicToolCall → sendRuntimeRequest → daemon callTool → server /session/tool-call); the 60 s comes from the MCP client.
  • Claude Code does not hit this because it has a native AskUserQuestion (supportsNativeUserQuestion).
  • Codex dynamic tools (item/tool/call over app-server) have no timeout in codex-rs; the Codex mention in the Discord thread needs a separate repro.

Suggested priority and effort

High: every ACP user who takes longer than a minute to answer a question loses the answer, and the agent proceeds on a wrong premise. Effort: small. Send notifications/progress for the call's progressToken while the call is pending.

Thread: thr_scbf6inpv6

AGENT GENERATED: by Claude Opus 5

Activity

  1. added
    providers
    plugins
    bug
    on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpluginsproviders

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions