openai/codex · error · anyhow::Error

duplicate compaction install for

Error message

duplicate compaction install for {compaction_id}

What it means

Consistency guard in reduce_compaction_installed_event: an install event arrives for a compaction id that already exists in the reduced rollout, i.e. the checkpoint was installed twice. The duplicated install event in the stream is the input at fault.

Solutions

  1. Inspect the rollout for replayed compaction install events
  2. Fix the producer to emit each compaction install exactly once
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/compaction.rs:126 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/fb7ae1f60d7ea5a2. Report an issue: GitHub.

Appendix: source

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

        request.execution.status = status;
        request.raw_response_payload_id = response_payload.map(|payload| payload.raw_payload_id);
        Ok(())
    }

    /// Installs a compaction checkpoint into the reduced conversation graph.
    ///
    /// This is the semantic boundary where replacement history becomes the live
    /// thread history; request attempts alone do not imply that change.
    pub(super) fn reduce_compaction_installed_event(
        &mut self,
        wall_time_unix_ms: i64,
        thread_id: String,
        codex_turn_id: String,
        compaction_id: String,
        checkpoint_payload: RawPayloadRef,
    ) -> Result<()> {
        if self.rollout.compactions.contains_key(&compaction_id) {
            bail!("duplicate compaction install for {compaction_id}");
        }
        self.thread_mut(&thread_id)?;
        let Some(turn) = self.rollout.codex_turns.get(&codex_turn_id) else {
            bail!(
                "compaction install {compaction_id} referenced unknown codex turn {codex_turn_id}"
            );
        };
        if turn.thread_id != thread_id {
            bail!(
                "compaction install {compaction_id} used thread {thread_id}, but codex turn {codex_turn_id} belongs to {}",
                turn.thread_id
            );
        }
        let checkpoint = self.reduce_compaction_checkpoint(
            wall_time_unix_ms,
            &thread_id,
            codex_turn_id.as_str(),
            &compaction_id,

View on GitHub (pinned to 339751715c)