openai/codex · error · anyhow::Error
code cell start referenced unknown Codex turn
Error message
code cell start referenced unknown Codex turn {codex_turn_id} What it means
Referential guard in validate_code_cell_turn: the code cell start references a Codex turn id that is not present in the reduced rollout. The unknown codex_turn_id in the start event is the input at fault.
Solutions
- Check the rollout for a missing turn-start event for that turn id
- Fix event ordering so turns are recorded before code cells that reference them
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/rollout-trace/src/reducer/code_cell.rs:645 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/6ea9cbd741ed4150.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/rollout-trace/src/reducer/code_cell.rs:645
) -> Result<ToolCallRequester> {
match requester {
RawToolCallRequester::Model => Ok(ToolCallRequester::Model),
RawToolCallRequester::CodeCell { runtime_cell_id } => Ok(ToolCallRequester::CodeCell {
code_cell_id: self.code_cell_id_for_runtime_cell_id(
thread_id,
&runtime_cell_id,
"code-mode nested tool",
)?,
}),
}
}
fn validate_code_cell_turn(&self, thread_id: &str, codex_turn_id: &str) -> Result<()> {
if !self.rollout.threads.contains_key(thread_id) {
bail!("code cell start referenced unknown thread {thread_id}");
}
let Some(turn) = self.rollout.codex_turns.get(codex_turn_id) else {
bail!("code cell start referenced unknown Codex turn {codex_turn_id}");
};
if turn.thread_id != thread_id {
bail!(
"code cell start used thread {thread_id}, but Codex turn {codex_turn_id} belongs \
to {}",
turn.thread_id
);
}
Ok(())
}
fn model_visible_code_cell_item_ids(
&self,
thread_id: &str,
call_id: &str,
kind: ConversationItemKind,
) -> Vec<String> {
self.rolloutView on GitHub (pinned to 339751715c)