openai/codex · error

tool runtime start referenced unknown call

Error message

tool runtime start referenced unknown call {tool_call_id}

What it means

A runtime-begin observation referenced a tool_call_id that was never started; runtime observations can only enrich an existing generic tool call.

Solutions

  1. Apply tool call start events before runtime observations
  2. Buffer runtime observations until the start arrives
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:245 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/0de1ea90408b2fa1. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:245

        }
        self.attach_agent_interaction_tool_result(&tool_call_id, result_payload.as_ref())?;
        Ok(())
    }

    /// Records a runtime-begin observation for an already started tool call.
    ///
    /// Runtime observations enrich the generic tool with protocol facts and may
    /// create domain-specific children such as terminal operations or agent edges.
    pub(super) fn start_tool_runtime_observation(
        &mut self,
        seq: RawEventSeq,
        wall_time_unix_ms: i64,
        tool_call_id: ToolCallId,
        runtime_payload: RawPayloadRef,
    ) -> Result<()> {
        let (thread_id, _requester, kind, existing_terminal_operation_id) = {
            let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {
                bail!("tool runtime start referenced unknown call {tool_call_id}");
            };
            push_unique(
                &mut tool_call.raw_runtime_payload_ids,
                &runtime_payload.raw_payload_id,
            );
            (
                tool_call.thread_id.clone(),
                tool_call.requester.clone(),
                tool_call.kind.clone(),
                tool_call.terminal_operation_id.clone(),
            )
        };
        if existing_terminal_operation_id.is_some()
            && matches!(kind, ToolCallKind::ExecCommand | ToolCallKind::WriteStdin)
        {
            bail!("tool runtime start would create a second terminal operation for {tool_call_id}");
        }

View on GitHub (pinned to 339751715c)