openai/codex · error · anyhow::Error
code-mode host bulk websocket pairing was abandoned
Error message
code-mode host bulk websocket pairing was abandoned
What it means
Returned inside run_connection when the registration handle for a negotiated dual-lane (bulk websocket) connection was dropped before pairing completed — the client side abandoned the bulk pairing. Wraps the abandoned registration so the connection unwinds cleanly.
Solutions
- Ensure the client opens the bulk websocket after negotiating the dual transport
- Check client logs for why pairing was abandoned
- Retry the connection
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at codex-rs/code-mode-host/src/lib.rs:132 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/29988100da59e537.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/code-mode-host/src/lib.rs:132
)
.await
}
async fn run_connection(
mut reader: ConnectionReader,
mut writer: ConnectionWriter,
limits: Arc<HostLimits>,
bulk_connections: Option<BulkConnectionRegistry>,
) -> Result<()> {
let negotiated = negotiate(&mut reader, &mut writer, bulk_connections.as_ref()).await?;
let bulk_connection = match negotiated {
NegotiatedConnection::Rejected => return Ok(()),
NegotiatedConnection::Single => None,
NegotiatedConnection::Dual(mut registration) => {
match tokio::time::timeout(BULK_PAIRING_TIMEOUT, registration.receive()).await {
Ok(Ok(connection)) => Some(connection),
Ok(Err(_)) => {
anyhow::bail!("code-mode host bulk websocket pairing was abandoned");
}
Err(_) => {
anyhow::bail!("timed out pairing code-mode host bulk websocket");
}
}
}
};
let (mut bulk_reader, bulk_writer) = match bulk_connection {
Some(connection) => (Some(connection.reader), Some(connection.writer)),
None => (None, None),
};
let (outgoing_tx, outgoing_rx) = mpsc::channel::<EncodedFrame>(OUTGOING_CHANNEL_CAPACITY);
let (bulk_tx, bulk_rx) = if bulk_writer.is_some() {
let (sender, receiver) = mpsc::channel::<EncodedFrame>(MAX_PENDING_DELEGATE_CALLS);
(Some(sender), Some(receiver))
} else {
(None, None)
};View on GitHub (pinned to 339751715c)