{"record":{"id":"d1116d6ec7f269c2","repo":"xai-org/grok-build","slug":"32603","errorCode":"-32603","errorMessage":"{action} timed out after {}s. It may still finish in the background; retrying right away can run into the same delay.","messagePattern":"(.+?) timed out after (.+?)s\\. It may still finish in the background; retrying right away can run into the same delay\\.","errorType":"error_code","errorClass":"acp::Error","httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/app/effects/helpers.rs","lineNumber":42,"sourceCode":"pub(super) fn session_rpc_timeout() -> std::time::Duration {\n    SESSION_RPC_FLOOR.max(xai_grok_workspace::envrc::loader_budget() + SESSION_RPC_SLACK)\n}\n/// `acp_send` bounded by [`session_rpc_timeout`]; on expiry, an error naming `action` instead of an eternal spinner.\npub(super) async fn acp_send_bounded<R, T>(\n    request: T,\n    tx: &tokio::sync::mpsc::UnboundedSender<R>,\n    action: &str,\n) -> Result<T::Response, acp::Error>\nwhere\n    T: xai_acp_lib::AcpRequest,\n    R: From<xai_acp_lib::AcpArgs<T>> + std::fmt::Debug,\n{\n    let timeout = session_rpc_timeout();\n    match tokio::time::timeout(timeout, acp_send(request, tx)).await {\n        Ok(result) => result,\n        Err(_elapsed) => {\n            Err(\n                acp::Error::new(\n                    acp::ErrorCode::InternalError.into(),\n                    format!(\n                \"{action} timed out after {}s. It may still finish in the background; \\\n                 retrying right away can run into the same delay.\",\n                timeout.as_secs()\n            ),\n                ),\n            )\n        }\n    }\n}\n/// Typed progress message for session restore.\n/// Keeps the progress channel from accepting arbitrary `TaskResult` variants.\npub(crate) struct RestoreProgressMsg {\n    pub agent_id: AgentId,\n    pub message: String,\n}\npub(super) fn log_prompt_result(","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/app/effects/helpers.rs#L24-L60","documentation":"An ACP -32603 InternalError raised by acp_send_bounded when a session RPC wrapped in tokio::time::timeout(session_rpc_timeout()) does not complete in time. The message names the action and the configured timeout, and warns the operation may still complete in the background, so an immediate retry may hit the same delay.","triggerScenarios":"Any ACP request routed through acp_send_bounded whose future does not resolve within session_rpc_timeout() — slow model/streaming session, blocked session task, or a very low timeout configuration.","commonSituations":"Long-running prompts against a slow backend; overloaded server leaving the session unresponsive; session_rpc_timeout set too low for the workload; deadlocked session handler.","solutions":["Increase session_rpc_timeout() to accommodate the slow action","Retry after waiting, since the action may still finish in the background (avoid immediate retry per the message)","Investigate why the session handler is slow or stuck (logs around the action)","Check backend health/latency for the underlying model or RPC"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// sanity-check the timeout budget before issuing the call\nlet t = session_rpc_timeout();\nassert!(t > Duration::from_secs(5), \"session_rpc_timeout too small\");","typeGuard":null,"tryCatchPattern":"match result {\n  Err(e) if e.code == -32603 && e.message.contains(\"timed out\") => {\n    tokio::time::sleep(backoff).await; // wait before retry, action may still complete\n    retry_with_longer_timeout()\n  }\n  r => r,\n}","preventionTips":["Set session_rpc_timeout generously for long actions","Use exponential backoff instead of immediate retries","Monitor session handler latency and backend health"],"tags":["timeout","acp","rpc","tokio"],"backgroundTag":"request-timeout","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}