openai/codex · error · anyhow::Error

compaction request completion used compaction , but start…

Error message

compaction request {compaction_request_id} completion used compaction {compaction_id}, but start used {}

What it means

Cross-reference guard in complete_compaction_request: the completion names a compaction id that differs from the one recorded on the matching request start, so the events cannot be paired. Mismatched compaction ids between start and completion are the inputs at fault.

Solutions

  1. Ensure the completion event carries the same compaction id as its start
  2. Fix the producer that emits inconsistent compaction ids across the request lifecycle
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

        &mut self,
        seq: RawEventSeq,
        wall_time_unix_ms: i64,
        compaction_id: String,
        compaction_request_id: CompactionRequestId,
        status: ExecutionStatus,
        response_payload: Option<RawPayloadRef>,
    ) -> Result<()> {
        let Some(request) = self
            .rollout
            .compaction_requests
            .get_mut(&compaction_request_id)
        else {
            bail!(
                "compaction request completion referenced unknown request {compaction_request_id}"
            );
        };
        if request.compaction_id != compaction_id {
            bail!(
                "compaction request {compaction_request_id} completion used compaction {compaction_id}, but start used {}",
                request.compaction_id
            );
        }
        request.execution.ended_at_unix_ms = Some(wall_time_unix_ms);
        request.execution.ended_seq = Some(seq);
        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,

View on GitHub (pinned to 339751715c)