{"record":{"id":"5623a53189ea0c3e","repo":"openai/codex","slug":"tool-call-end-referenced-unknown-call-tool-call-i","errorCode":null,"errorMessage":"tool call end referenced unknown call {tool_call_id}","messagePattern":"tool call end referenced unknown call (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool.rs","lineNumber":200,"sourceCode":"        }\n        Ok(())\n    }\n\n    /// Completes the canonical tool call and any terminal operation driven by dispatch output.\n    ///\n    /// Protocol-backed terminal tools end from runtime events; direct tools\n    /// may only have the canonical result payload, so this method handles both paths.\n    pub(super) fn end_tool_call(\n        &mut self,\n        seq: RawEventSeq,\n        wall_time_unix_ms: i64,\n        tool_call_id: ToolCallId,\n        status: ExecutionStatus,\n        result_payload: Option<RawPayloadRef>,\n    ) -> Result<()> {\n        let (terminal_operation_id, thread_id, end_terminal_from_result) = {\n            let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {\n                bail!(\"tool call end referenced unknown call {tool_call_id}\");\n            };\n            tool_call.execution.ended_at_unix_ms = Some(wall_time_unix_ms);\n            tool_call.execution.ended_seq = Some(seq);\n            tool_call.execution.status = status.clone();\n            tool_call.raw_result_payload_id = result_payload\n                .as_ref()\n                .map(|payload| payload.raw_payload_id.clone());\n            (\n                tool_call.terminal_operation_id.clone(),\n                tool_call.thread_id.clone(),\n                // Protocol-backed tools end terminal operations from\n                // runtime observations. Dispatch result payloads are still kept\n                // on ToolCall, but they are caller-facing and may be transformed\n                // relative to the raw terminal output.\n                tool_call.raw_runtime_payload_ids.is_empty(),\n            )\n        };\n        if end_terminal_from_result && let Some(operation_id) = terminal_operation_id {","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool.rs#L182-L218","documentation":"Error \"tool call end referenced unknown call {tool_call_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}