Repository navigation
Description
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
mainat 15db360 - Linux, Node v24.18.0
- Provider: ACP (
provider-acp) with OpenCode. OpenCode uses the MCP TypeScript SDK client (@modelcontextprotocol/sdk).
Steps to reproduce
- Start a thread with OpenCode through the ACP provider.
- Send:
Use the AskUserQuestion tool to ask me which database to use: SQLite or Postgres. Wait for my answer. - Wait more than 60 seconds before you answer the card.
- 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:
bb/plugins/provider-acp/src/bridge/tool-proxy-mcp.ts
Lines 203 to 245 in 15db360
| 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:
bb/plugins/ask-user-question/src/server.ts
Lines 39 to 57 in 15db360
| ); | |
| } | |
| 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→ daemoncallTool→ 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/callover 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
Send MCP progress during ACP dynamic tool calls so AskUserQuestion do…