{"record":{"id":"06449cd054863a67","repo":"openai/codex","slug":"terminal-operation-operation-id-changed-process","errorCode":null,"errorMessage":"terminal operation {operation_id} changed process id from {existing} to {process_id}","messagePattern":"terminal operation (.+?) changed process id from (.+?) to (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool/terminal.rs","lineNumber":200,"sourceCode":"            })\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);\n            operation.execution.ended_seq = Some(seq);\n            operation.execution.status = status;\n\n            if let Some((raw_payload_id, response)) = response {\n                push_unique(&mut operation.raw_payload_ids, &raw_payload_id);\n                // If begin and end both report a process id they must name the\n                // same terminal. If begin omitted it, the end event completes\n                // the session join key for this operation.\n                match (&operation.terminal_id, response.terminal_id.as_deref()) {\n                    (Some(existing), Some(process_id)) if existing != process_id => {\n                        bail!(\n                            \"terminal operation {operation_id} changed process id from \\\n                             {existing} to {process_id}\"\n                        );\n                    }\n                    (None, Some(process_id)) => {\n                        operation.terminal_id = Some(process_id.to_string());\n                    }\n                    (Some(_), Some(_)) | (Some(_), None) | (None, None) => {}\n                }\n                operation.result = Some(response.result);\n            }\n\n            (\n                operation.terminal_id.clone(),\n                operation.execution.started_at_unix_ms,\n                operation.execution.started_seq,\n            )\n        };","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool/terminal.rs#L182-L218","documentation":"Error \"terminal operation {operation_id} changed process id from {existing} to {process_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool/terminal.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"}