openai/codex · error · anyhow::Error
code-mode client sent a message on the wrong websocket lane
Error message
code-mode client sent a message on the wrong websocket lane
What it means
Protocol violation in drive_writer/negotiate: with dual transports active, the client sent a message on a websocket lane that does not accept that message type (allows_transport_lane failed), indicating a buggy or incompatible client.
Solutions
- Update the code-mode client to a compatible version
- Check that control messages go on the control lane and bulk data on the bulk lane
- Report the violation with client version details
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/code-mode-host/src/lib.rs:216 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/2a63173b931d0c5f.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/code-mode-host/src/lib.rs:216
message = reader.read() => (
message.context("failed to read code-mode client control message")?,
TransportLane::Control,
),
message = async {
match &mut bulk_reader {
Some(reader) => reader.read().await,
None => Ok(None),
}
}, if bulk_reader.is_some() => (
message.context("failed to read code-mode client bulk message")?,
TransportLane::Bulk,
),
};
let Some(message) = message else {
break;
};
if bulk_reader.is_some() && !message.allows_transport_lane(lane) {
anyhow::bail!("code-mode client sent a message on the wrong websocket lane");
}
match message {
ClientToHost::ClientHello(_) => {
anyhow::bail!("received a second code-mode client hello");
}
ClientToHost::Request { id, request } => {
state.spawn_request(id, request)?;
}
ClientToHost::CancelRequest { id } => {
state.cancel_request(id);
}
ClientToHost::DelegateResponse { id, result } => {
peer.complete(id, result.into_result()).await;
}
}
}
Ok::<(), anyhow::Error>(())
}View on GitHub (pinned to 339751715c)