openai/codex · error · anyhow::Error
recovered handshake succeeded but server info was missing
Error message
recovered handshake succeeded but server info was missing
What it means
Post-recovery consistency check: the reinitialized handshake after a session-expiry 404 succeeded, but the server's initialize result again omitted peer info, so ServerPeerInfo cannot be rebuilt. The server's InitializeResult is the incomplete input.
Solutions
- Fix the MCP server to always return serverInfo in its initialize result
- Retry recovery; if the server persistently omits peer info, replace or upgrade it
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/rmcp-client/src/rmcp_client.rs:1465 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- SSL/TLS and certificate errors — how TLS handshakes and certificate validation fail.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/1ee2c69512e0e4cf.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/rmcp-client/src/rmcp_client.rs:1465
let initialize_context = self
.initialize_context
.lock()
.await
.clone()
.ok_or_else(|| anyhow!("MCP client cannot recover before initialize succeeds"))?;
let pending_transport = Self::create_pending_transport(&self.transport_recipe).await?;
let (service, oauth_persistor) = self
.connect_pending_transport_with_initialize_retries(
pending_transport,
initialize_context.client_service,
initialize_context.timeout,
)
.await?;
service
.peer()
.peer_info()
.ok_or_else(|| anyhow!("recovered handshake succeeded but server info was missing"))?;
{
let mut guard = self.state.lock().await;
if matches!(*guard, ClientState::Closed) {
return Err(anyhow!("MCP client is shut down"));
}
*guard = ClientState::Ready {
service,
oauth: oauth_persistor.clone(),
};
}
if let Some(runtime) = oauth_persistor
&& let Err(error) = runtime.persist_if_needed().await
{
warn!("failed to persist OAuth tokens after session recovery: {error}");
}
View on GitHub (pinned to 339751715c)