{"record":{"id":"42466e7960cb3df4","repo":"openai/codex","slug":"tool-runtime-start-would-create-a-second-terminal","errorCode":null,"errorMessage":"tool runtime start would create a second terminal operation for {tool_call_id}","messagePattern":"tool runtime start would create a second terminal operation for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool.rs","lineNumber":261,"sourceCode":"        let (thread_id, _requester, kind, existing_terminal_operation_id) = {\n            let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {\n                bail!(\"tool runtime start referenced unknown call {tool_call_id}\");\n            };\n            push_unique(\n                &mut tool_call.raw_runtime_payload_ids,\n                &runtime_payload.raw_payload_id,\n            );\n            (\n                tool_call.thread_id.clone(),\n                tool_call.requester.clone(),\n                tool_call.kind.clone(),\n                tool_call.terminal_operation_id.clone(),\n            )\n        };\n        if existing_terminal_operation_id.is_some()\n            && matches!(kind, ToolCallKind::ExecCommand | ToolCallKind::WriteStdin)\n        {\n            bail!(\"tool runtime start would create a second terminal operation for {tool_call_id}\");\n        }\n\n        // Protocol begin events carry runtime facts such as process ids and\n        // cwd. These facts should create terminal rows, but they must not\n        // replace the canonical invocation payload captured at dispatch.\n        let terminal_operation_id = self.start_terminal_operation_from_runtime(\n            seq,\n            wall_time_unix_ms,\n            &thread_id,\n            &tool_call_id,\n            &kind,\n            &runtime_payload,\n        )?;\n\n        if let Some(operation_id) = &terminal_operation_id {\n            let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {\n                bail!(\"tool call {tool_call_id} disappeared during runtime start reduction\");\n            };","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool.rs#L243-L279","documentation":"Error \"tool runtime start would create a second terminal operation for {tool_call_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:261 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"}