openai/codex · error · anyhow::Error

inference response referenced unknown call

Error message

inference response referenced unknown call {inference_call_id}

What it means

A response-completion event arrived for an inference_call_id that is not in the reducer's registry, meaning the start event was never applied or was lost.

Solutions

  1. Ensure inference start events are applied before completions and are not dropped
  2. Ignore completions for calls outside the traced window
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/conversation.rs:152 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/23747a9264fdbba1. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rollout-trace/src/reducer/conversation.rs:152

        wall_time_unix_ms: i64,
        inference_call_id: &InferenceCallId,
        response_payload: &RawPayloadRef,
    ) -> Result<Vec<String>> {
        let payload = self.read_payload_json(response_payload)?;
        let Some(output_items) = payload.get("output_items").and_then(Value::as_array) else {
            bail!(
                "inference response payload {} did not contain output_items",
                response_payload.raw_payload_id
            );
        };

        let Some((thread_id, codex_turn_id)) = self
            .rollout
            .inference_calls
            .get(inference_call_id)
            .map(|inference| (inference.thread_id.clone(), inference.codex_turn_id.clone()))
        else {
            bail!("inference response referenced unknown call {inference_call_id}");
        };

        let items = normalize::normalize_model_items(output_items, response_payload)?;
        // Response output is appended immediately: it was produced by the model,
        // so it is conversation even before a later request carries it forward.
        let append_at = self
            .thread_conversation_snapshots
            .get(&thread_id)
            .map_or(0, Vec::len);
        let response_item_ids = self.reconcile_conversation_items(
            items,
            ReconcileItems {
                thread_id: &thread_id,
                codex_turn_id: &codex_turn_id,
                wall_time_unix_ms,
                produced_by: vec![ProducerRef::Inference {
                    inference_call_id: inference_call_id.clone(),
                }],

View on GitHub (pinned to 339751715c)