{"record":{"id":"c4b97eaf3b8c296f","repo":"openai/codex","slug":"compaction-request-used-thread-but-codex-tu","errorCode":null,"errorMessage":"compaction request {} used thread {}, but codex turn {} belongs to {}","messagePattern":"compaction request (.+?) used thread (.+?), but codex turn (.+?) belongs to (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/compaction.rs","lineNumber":46,"sourceCode":"            .rollout\n            .compaction_requests\n            .contains_key(&started.compaction_request_id)\n        {\n            bail!(\n                \"duplicate compaction request start for {}\",\n                started.compaction_request_id\n            );\n        }\n        self.thread_mut(&started.thread_id)?;\n        let Some(turn) = self.rollout.codex_turns.get(&started.codex_turn_id) else {\n            bail!(\n                \"compaction request {} referenced unknown codex turn {}\",\n                started.compaction_request_id,\n                started.codex_turn_id\n            );\n        };\n        if turn.thread_id != started.thread_id {\n            bail!(\n                \"compaction request {} used thread {}, but codex turn {} belongs to {}\",\n                started.compaction_request_id,\n                started.thread_id,\n                started.codex_turn_id,\n                turn.thread_id\n            );\n        }\n\n        self.rollout.compaction_requests.insert(\n            started.compaction_request_id.clone(),\n            CompactionRequest {\n                compaction_request_id: started.compaction_request_id,\n                compaction_id: started.compaction_id,\n                thread_id: started.thread_id,\n                codex_turn_id: started.codex_turn_id,\n                execution: ExecutionWindow {\n                    started_at_unix_ms: wall_time_unix_ms,\n                    started_seq: seq,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/compaction.rs#L28-L64","documentation":"Error \"compaction request {} used thread {}, but codex turn {} belongs to {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/compaction.rs:46 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"}