{"record":{"id":"bb1be6074b020d30","repo":"openai/codex","slug":"timed-out-handshaking-with-mcp-server-after-durat-bb1be6","errorCode":null,"errorMessage":"timed out handshaking with MCP server after {duration:?}","messagePattern":"timed out handshaking with MCP server after (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/streamable_http_retry.rs","lineNumber":99,"sourceCode":"                .connect_pending_transport(transport, client_service.clone(), attempt_timeout)\n                .await\n            {\n                Ok(result) => return Ok(result),\n                Err(error) if should_retry && Self::is_retryable_initialize_error(&error) => {\n                    let Some(retry_delay_ms) = retry_delay_ms else {\n                        return Err(error);\n                    };\n                    let delay = Duration::from_millis(retry_delay_ms);\n                    warn!(\n                        attempt = attempt + 1,\n                        max_attempts = STREAMABLE_HTTP_RETRY_DELAYS_MS.len() + 1,\n                        delay_ms = delay.as_millis(),\n                        error = %error,\n                        \"streamable HTTP MCP initialize failed with a retryable error; retrying\"\n                    );\n                    if !sleep_with_retry_deadline(delay, retry_deadline).await {\n                        let duration = timeout.unwrap_or(delay);\n                        return Err(anyhow!(\n                            \"timed out handshaking with MCP server after {duration:?}\"\n                        ));\n                    }\n                }\n                Err(error) => return Err(error),\n            }\n        }\n\n        unreachable!(\"initialize retry loop should return on success or final error\")\n    }\n\n    fn is_retryable_initialize_error(error: &anyhow::Error) -> bool {\n        error.chain().any(|source| {\n            source\n                .downcast_ref::<HandshakeError>()\n                .is_some_and(|error| Self::is_retryable_client_initialize_error(&error.source))\n                || source\n                    .downcast_ref::<rmcp::service::ClientInitializeError>()","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/streamable_http_retry.rs#L81-L117","documentation":"Error \"timed out handshaking with MCP server after {duration:?}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/streamable_http_retry.rs:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}