openai/codex · error · anyhow::Error

code cell initial response referenced unknown cell

Error message

code cell initial response referenced unknown cell {code_cell_id}

What it means

Consistency guard in record_or_queue_code_cell_initial_response: an initial-response runtime event references a code cell id that is neither reduced nor pending, so it cannot be attached. Indicates an event ordering gap where the start event was never seen.

Solutions

  1. Check the rollout for a missing code cell start event before this response
  2. Regenerate the trace; report missing-start events as a recorder issue
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/code_cell.rs:258 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/2220ce603f17e31e. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rollout-trace/src/reducer/code_cell.rs:258

        runtime_cell_id: String,
        status: CodeCellRuntimeStatus,
    ) -> Result<()> {
        if !self.rollout.code_cells.contains_key(&code_cell_id) {
            if self.pending_code_cell_starts.contains_key(&code_cell_id) {
                self.queue_code_cell_lifecycle_event(
                    code_cell_id,
                    PendingCodeCellLifecycleEvent {
                        seq,
                        wall_time_unix_ms,
                        kind: PendingCodeCellLifecycleEventKind::InitialResponse {
                            runtime_cell_id,
                            status,
                        },
                    },
                );
                return Ok(());
            }
            bail!("code cell initial response referenced unknown cell {code_cell_id}");
        }
        self.record_code_cell_initial_response(
            seq,
            wall_time_unix_ms,
            code_cell_id,
            runtime_cell_id,
            status,
        )
    }

    fn record_code_cell_initial_response(
        &mut self,
        seq: RawEventSeq,
        wall_time_unix_ms: i64,
        code_cell_id: CodeCellId,
        runtime_cell_id: String,
        status: CodeCellRuntimeStatus,
    ) -> Result<()> {

View on GitHub (pinned to 339751715c)