openai/codex · error · anyhow::Error

executor OAuth credential key conflicts with a host-owned cr

Error message

executor OAuth credential key conflicts with a host-owned credential

What it means

Error "executor OAuth credential key conflicts with a host-owned credential" thrown in openai/codex.

Source

Thrown at codex-rs/rmcp-client/src/oauth.rs:873

    }

    Ok(None)
}

/// Saves one credential while holding the File aggregate-store lock across the full
/// read-modify-write operation.
fn save_oauth_tokens_to_file(tokens: &StoredOAuthTokens) -> Result<()> {
    let _store_lock = OAuthStoreLock::acquire_for_write(OAuthStore::File)?;
    save_oauth_tokens_to_file_with_lock_held(tokens)
}

/// Updates the fallback File. The caller must hold the File aggregate-store lock.
fn save_oauth_tokens_to_file_with_lock_held(tokens: &StoredOAuthTokens) -> Result<()> {
    let key = compute_store_key(&tokens.server_name, &tokens.url)?;
    let mut store = read_fallback_file_unlocked()?.unwrap_or_default();
    let executor_owned = tokens.server_name.starts_with("executor:");
    if executor_owned && store.get(&key).is_some_and(|entry| !entry.executor_owned) {
        anyhow::bail!("executor OAuth credential key conflicts with a host-owned credential");
    }

    let token_response = &tokens.token_response.0;
    let expires_at = tokens
        .expires_at
        .or_else(|| compute_expires_at_millis(token_response));
    let refresh_token = token_response
        .refresh_token()
        .map(|token| token.secret().to_string());
    let scopes = token_response
        .scopes()
        .map(|s| s.iter().map(|s| s.to_string()).collect())
        .unwrap_or_default();
    let entry = FallbackTokenEntry {
        server_name: tokens.server_name.clone(),
        server_url: tokens.url.clone(),
        issuer: tokens.issuer.clone(),
        client_id: tokens.client_id.clone(),

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/rmcp-client/src/oauth.rs:873 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/3b578f1dfbc75ac9. Report an issue: GitHub.