openai/codex · error · anyhow::Error

compaction request {} used thread {}, but codex turn {} belo

Error message

compaction request {} used thread {}, but codex turn {} belongs to {}

What it means

Error "compaction request {} used thread {}, but codex turn {} belongs to {}" thrown in openai/codex.

Source

Thrown at codex-rs/rollout-trace/src/reducer/compaction.rs:46

            .rollout
            .compaction_requests
            .contains_key(&started.compaction_request_id)
        {
            bail!(
                "duplicate compaction request start for {}",
                started.compaction_request_id
            );
        }
        self.thread_mut(&started.thread_id)?;
        let Some(turn) = self.rollout.codex_turns.get(&started.codex_turn_id) else {
            bail!(
                "compaction request {} referenced unknown codex turn {}",
                started.compaction_request_id,
                started.codex_turn_id
            );
        };
        if turn.thread_id != started.thread_id {
            bail!(
                "compaction request {} used thread {}, but codex turn {} belongs to {}",
                started.compaction_request_id,
                started.thread_id,
                started.codex_turn_id,
                turn.thread_id
            );
        }

        self.rollout.compaction_requests.insert(
            started.compaction_request_id.clone(),
            CompactionRequest {
                compaction_request_id: started.compaction_request_id,
                compaction_id: started.compaction_id,
                thread_id: started.thread_id,
                codex_turn_id: started.codex_turn_id,
                execution: ExecutionWindow {
                    started_at_unix_ms: wall_time_unix_ms,
                    started_seq: seq,

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/compaction.rs:46 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/c4b97eaf3b8c296f. Report an issue: GitHub.