openai/codex · error · anyhow::Error
duplicate code-mode request ID {request_id:?}
Error message
duplicate code-mode request ID {request_id:?} What it means
Error "duplicate code-mode request ID {request_id:?}" thrown in openai/codex.
Source
Thrown at codex-rs/code-mode-host/src/lib.rs:704
kind: RequestKind,
cancellation: CancellationToken,
}
#[derive(Default)]
struct RequestRegistry {
active: HashMap<RequestId, ActiveRequest>,
recent: HashSet<RequestId>,
recent_order: VecDeque<RequestId>,
}
impl RequestRegistry {
fn start(
&mut self,
request_id: RequestId,
kind: RequestKind,
) -> Result<CancellationToken, anyhow::Error> {
if self.active.contains_key(&request_id) || self.recent.contains(&request_id) {
anyhow::bail!("duplicate code-mode request ID {request_id:?}");
}
let cancellation = CancellationToken::new();
self.active.insert(
request_id,
ActiveRequest {
kind,
cancellation: cancellation.clone(),
},
);
Ok(cancellation)
}
fn cancel(&mut self, request_id: RequestId) {
if let Some(request) = self.active.get(&request_id)
&& request.kind.is_cancellable()
{
request.cancellation.cancel();
}View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/code-mode-host/src/lib.rs:704 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/21ce0c07691118d1.
Report an issue: GitHub.