openai/codex · error
tool call start used thread {thread_id}, but Codex turn {cod
Error message
tool call start used thread {thread_id}, but Codex turn {codex_turn_id} belongs to {} What it means
Error "tool call start used thread {thread_id}, but Codex turn {codex_turn_id} belongs to {}" thrown in openai/codex.
Source
Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:401
self.rollout
.codex_turns
.get(codex_turn_id)
.map(|turn| turn.thread_id.clone())
.with_context(|| {
format!("tool call start referenced unknown Codex turn {codex_turn_id}")
})
}
fn validate_tool_turn(&self, thread_id: &str, codex_turn_id: Option<&str>) -> Result<()> {
if !self.rollout.threads.contains_key(thread_id) {
bail!("tool call start referenced unknown thread {thread_id}");
}
if let Some(codex_turn_id) = codex_turn_id {
let Some(turn) = self.rollout.codex_turns.get(codex_turn_id) else {
bail!("tool call start referenced unknown Codex turn {codex_turn_id}");
};
if turn.thread_id != thread_id {
bail!(
"tool call start used thread {thread_id}, but Codex turn {codex_turn_id} \
belongs to {}",
turn.thread_id
);
}
}
Ok(())
}
fn ensure_unique_model_visible_tool_call(
&self,
model_visible_call_id: Option<&str>,
tool_call_id: &str,
) -> Result<()> {
let Some(model_visible_call_id) = model_visible_call_id else {
return Ok(());
};
if let Some(existing) = self.single_tool_for_model_visible_call(model_visible_call_id)?View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:401 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/37608618387ccc50.
Report an issue: GitHub.