openai/codex · error · AgentIdentityAuthError

agent identity bootstrap unavailable after

Error message

agent identity bootstrap unavailable after {attempts} attempts during {operation}: {message}

What it means

Sentinel variant of AgentIdentityAuthError: the agent-identity auth flow gave up after a bounded number of bootstrap attempts during a named operation. It wraps the last failure message and signals that retrying the whole login flow is the expected recovery, since bootstrap failures are typically transient (network or auth-server issues).

Solutions

  1. Retry the agent identity login flow from the start after a short backoff
  2. Inspect the embedded message to see the underlying per-attempt failure and address it
  3. If attempts repeatedly fail, verify network reachability of the ChatGPT auth environment
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/login/src/auth/agent_identity.rs:83 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/772254d3dfe7d137. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/login/src/auth/agent_identity.rs:83

            Ok(base_url)
        }
        (Err(error), _) => Err(std::io::Error::other(error)),
    }
}

pub(super) fn require_agent_identity_authapi_base_url(
    agent_identity_authapi_base_url: Option<&str>,
) -> std::io::Result<&str> {
    agent_identity_authapi_base_url.ok_or_else(|| {
        std::io::Error::other(
            "Agent Identity only supports production and staging ChatGPT environments",
        )
    })
}

#[derive(Clone, Debug, Error)]
pub enum AgentIdentityAuthError {
    #[error(
        "agent identity bootstrap unavailable after {attempts} attempts during {operation}: {message}"
    )]
    BootstrapUnavailable {
        operation: &'static str,
        attempts: usize,
        message: String,
    },
}

impl AgentIdentityAuthError {
    pub(super) fn bootstrap_unavailable(error: &std::io::Error) -> Option<&Self> {
        match error
            .get_ref()
            .and_then(|source| source.downcast_ref::<Self>())
        {
            Some(error @ Self::BootstrapUnavailable { .. }) => Some(error),
            None => None,
        }

View on GitHub (pinned to 339751715c)