openai/codex · error

guardian review session was not available after spawn

Error message

guardian review session was not available after spawn

What it means

After spawning the guardian trunk review session, the internal state's trunk slot was still None, meaning the spawned session was not registered/available. This is an internal invariant failure in review session setup, surfaced as an anyhow error.

Solutions

  1. Retry the guardian review; the review session failed to spawn.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at codex-rs/core/src/guardian/review_session.rs:600 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/fad7f55aecda771d. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/core/src/guardian/review_session.rs:600

                        }
                        Err(outcome) => {
                            return (outcome, GuardianReviewAnalyticsResult::without_session());
                        }
                    };
                    state.trunk = Some(Arc::clone(&review_session));
                    spawned_trunk = true;
                }

                state.trunk.as_ref().cloned()
            }
            Err(outcome) => {
                return (outcome, GuardianReviewAnalyticsResult::without_session());
            }
        };

        let Some(trunk) = trunk_candidate else {
            return (
                GuardianReviewSessionOutcome::Completed(Err(anyhow!(
                    "guardian review session was not available after spawn"
                ))),
                GuardianReviewAnalyticsResult::without_session(),
            );
        };

        if trunk.reuse_key != next_reuse_key {
            return Box::pin(self.run_ephemeral_review(
                params,
                next_reuse_key,
                deadline,
                parent_compaction,
                /*fork_snapshot*/ None,
            ))
            .await;
        }

        let trunk_guard = match trunk.review_lock.try_acquire() {

View on GitHub (pinned to 339751715c)