{"record":{"id":"1b8a5129dbb7df74","repo":"openai/codex","slug":"timed-out-handshaking-with-mcp-server-after-durat","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/rmcp_client.rs","lineNumber":1235,"sourceCode":"                client_service\n                    .serve_with_lifecycle(transport, lifecycle)\n                    .boxed(),\n                Some(oauth_persistor),\n            ),\n            PendingTransport::StreamableHttpWithAccessTokenOnly { transport } => (\n                client_service\n                    .serve_with_lifecycle(transport, lifecycle)\n                    .boxed(),\n                None,\n            ),\n        };\n\n        let service_result = match timeout {\n            Some(duration) => match time::timeout(duration, transport).await {\n                Ok(result) => {\n                    result.map_err(|source| anyhow::Error::from(HandshakeError { source }))\n                }\n                Err(_elapsed) => Err(anyhow!(\n                    \"timed out handshaking with MCP server after {duration:?}\"\n                )),\n            },\n            None => transport\n                .await\n                .map_err(|source| anyhow::Error::from(HandshakeError { source })),\n        };\n        let service = match service_result {\n            Ok(service) => service,\n            Err(error) => {\n                if let Some(runtime) = oauth_persistor.as_ref()\n                    && let Err(persist_error) = runtime.persist_if_needed().await\n                {\n                    warn!(\n                        \"failed to persist OAuth tokens after failed initialize: {persist_error}\"\n                    );\n                }\n                return Err(error);","sourceCodeStart":1217,"sourceCodeEnd":1253,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/rmcp_client.rs#L1217-L1253","documentation":"Error \"timed out handshaking with MCP server after {duration:?}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/rmcp_client.rs:1235 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"}