{"record":{"id":"ed1d9444835b6fde","repo":"openai/codex","slug":"sub-agent-activity-does-not-match-tool-call-k","errorCode":null,"errorMessage":"sub-agent activity {:?} does not match tool call kind {tool_kind:?}","messagePattern":"sub-agent activity (.+?) does not match tool call kind (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool/agents.rs","lineNumber":238,"sourceCode":"                    target_thread_id,\n                    /*unresolved_spawn_thread_id*/ None,\n                ),\n            (ToolCallKind::SendMessage, SubAgentActivityKind::Interacted) => self\n                .queue_sub_agent_activity_message_edge(\n                    wall_time_unix_ms,\n                    tool_call_id,\n                    tool_edge_id(tool_call_id),\n                    InteractionEdgeKind::SendMessage,\n                    target_thread_id,\n                    /*unresolved_spawn_thread_id*/ None,\n                ),\n            (ToolCallKind::CloseAgent, SubAgentActivityKind::Interrupted) => self\n                .upsert_close_agent_interaction(\n                    tool_call_id,\n                    target_thread_id,\n                    Some(wall_time_unix_ms),\n                ),\n            _ => bail!(\n                \"sub-agent activity {:?} does not match tool call kind {tool_kind:?}\",\n                payload.kind\n            ),\n        }\n    }\n\n    fn queue_sub_agent_activity_message_edge(\n        &mut self,\n        wall_time_unix_ms: i64,\n        tool_call_id: &str,\n        edge_id: String,\n        edge_kind: InteractionEdgeKind,\n        target_thread_id: String,\n        unresolved_spawn_thread_id: Option<String>,\n    ) -> Result<()> {\n        let tool_call = self.rollout.tool_calls.get(tool_call_id).with_context(|| {\n            format!(\"agent activity referenced unknown tool call {tool_call_id}\")\n        })?;","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool/agents.rs#L220-L256","documentation":"Error \"sub-agent activity {:?} does not match tool call kind {tool_kind:?}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool/agents.rs:238 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"}