{"record":{"id":"089e2b25a4de204c","repo":"openai/codex","slug":"terminal-end-referenced-unknown-operation-operati","errorCode":null,"errorMessage":"terminal end referenced unknown operation {operation_id}","messagePattern":"terminal end referenced unknown operation (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool/terminal.rs","lineNumber":171,"sourceCode":"    ///\n    /// Non-terminal tools flow through the same generic tool lifecycle, so callers\n    /// may invoke this unconditionally and receive Ok for unrelated tool kinds.\n    pub(in crate::reducer) fn end_terminal_operation(\n        &mut self,\n        seq: RawEventSeq,\n        wall_time_unix_ms: i64,\n        thread_id: &str,\n        operation_id: &str,\n        status: ExecutionStatus,\n        response_payload: Option<&RawPayloadRef>,\n    ) -> Result<()> {\n        let Some(operation_kind) = self\n            .rollout\n            .terminal_operations\n            .get(operation_id)\n            .map(|operation| operation.kind.clone())\n        else {\n            bail!(\"terminal end referenced unknown operation {operation_id}\");\n        };\n        let response = response_payload\n            .map(|payload| {\n                let value = self.read_payload_json(payload)?;\n                let response = parse_terminal_response_payload(\n                    value,\n                    &operation_kind,\n                    &payload.raw_payload_id,\n                )?;\n                Ok::<_, anyhow::Error>((payload.raw_payload_id.clone(), response))\n            })\n            .transpose()?;\n\n        let (terminal_id, started_at_unix_ms, started_seq) = {\n            let Some(operation) = self.rollout.terminal_operations.get_mut(operation_id) else {\n                bail!(\"terminal end referenced unknown operation {operation_id}\");\n            };\n            operation.execution.ended_at_unix_ms = Some(wall_time_unix_ms);","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool/terminal.rs#L153-L189","documentation":"Error \"terminal end referenced unknown operation {operation_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool/terminal.rs:171 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"}