{"record":{"id":"53d542a53d55fd7d","repo":"xai-org/grok-build","slug":"failed-to-reach-the-client-for-user-question-msg","errorCode":null,"errorMessage":"Failed to reach the client for user question: {msg}","messagePattern":"Failed to reach the client for user question: (.+?)","errorType":"error_code","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-tools/src/implementations/grok_build/ask_user_question/mod.rs","lineNumber":521,"sourceCode":"                questions,\n                partial_answers,\n            }) => {\n                let message = format::format_chat_about_this(&questions, &partial_answers);\n                Ok(AskUserQuestionOutput::UserAnswered { message })\n            }\n            Ok(UserQuestionResponse::SkipInterview {\n                questions,\n                partial_answers,\n            }) => {\n                let message = format::format_skip_interview(&questions, &partial_answers);\n                Ok(AskUserQuestionOutput::UserAnswered { message })\n            }\n            Ok(UserQuestionResponse::Cancelled) => Ok(AskUserQuestionOutput::UserAnswered {\n                message: unanswered.to_string(),\n            }),\n            Err(UserQuestionError::TransportError(msg)) => {\n                Err(xai_tool_runtime::ToolError::execution(\n                    xai_tool_protocol::ToolId::new(\"ask_user_question\").expect(\"valid\"),\n                    format!(\"Failed to reach the client for user question: {msg}\"),\n                ))\n            }\n            Err(UserQuestionError::MalformedResponse(msg)) => {\n                Err(xai_tool_runtime::ToolError::execution(\n                    xai_tool_protocol::ToolId::new(\"ask_user_question\").expect(\"valid\"),\n                    format!(\"Client returned an invalid response to user question: {msg}\"),\n                ))\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::types::resources::Resources;\n    use crate::types::tool_metadata::test_ctx_with_call_id;","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-tools/src/implementations/grok_build/ask_user_question/mod.rs#L503-L539","documentation":"When the client answers the user question, its reply travels back through the transport layer. `UserQuestionError::TransportError(msg)` means the reply could not be delivered or fetched at the transport level, so the tool surfaces it as an execution error prefixed with 'Failed to reach the client for user question'. This indicates a communication problem with the client, not a bad answer payload.","triggerScenarios":"The ACP connection used to deliver the questionnaire or fetch its reply failed — e.g. sending the request over the transport errored, the reply read failed mid-transfer, or the peer connection was reset while the question was outstanding.","commonSituations":"Flaky or dropped connection between agent host and editor client; proxy/firewall terminating long-lived websocket/stdio sessions; client busy-restart while a question is in flight; version mismatch where the client lacks the user-question extension method.","solutions":["Inspect the embedded `{msg}` detail to identify the underlying transport failure (connection reset, write error, unsupported method).","Re-establish the client connection (reconnect ACP session) and retry the tool call.","Check that the client version supports the user-question ACP extension; upgrade the client/extension if not.","If networks are unstable, increase keep-alives/timeouts on the transport or reduce question round-trips by batching questions in one call."],"exampleFix":"// before: relying on a possibly stale connection\nawait tool(\"ask_user_question\", { questions });\n// after: ensure the connection is healthy first\nif (!await session.ping()) { await session.reconnect(); }\nawait tool(\"ask_user_question\", { questions });","handlingStrategy":"retry","validationCode":"// verify connectivity before the round-trip\nconst alive = await session.ping();\nif (!alive) throw new Error(\"client unreachable; reconnect before asking questions\");","typeGuard":null,"tryCatchPattern":"try {\n  const out = await tool(\"ask_user_question\", { questions });\n} catch (e) {\n  if (String(e.message).startsWith(\"Failed to reach the client\")) {\n    await backoffRetry(() => tool(\"ask_user_question\", { questions }), 3);\n  } else { throw e; }\n}","preventionTips":["Keep the ACP connection alive with heartbeats/keep-alives","Check client version supports the user-question extension before calling","Configure proxy/firewall rules for long-lived sessions","Retry with backoff on transient transport failures"],"tags":["transport","network","acp","client-communication"],"backgroundTag":"transport-error","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}