{"record":{"id":"3b578f1dfbc75ac9","repo":"openai/codex","slug":"executor-oauth-credential-key-conflicts-with-a-hos","errorCode":null,"errorMessage":"executor OAuth credential key conflicts with a host-owned credential","messagePattern":"executor OAuth credential key conflicts with a host-owned credential","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/oauth.rs","lineNumber":873,"sourceCode":"    }\n\n    Ok(None)\n}\n\n/// Saves one credential while holding the File aggregate-store lock across the full\n/// read-modify-write operation.\nfn save_oauth_tokens_to_file(tokens: &StoredOAuthTokens) -> Result<()> {\n    let _store_lock = OAuthStoreLock::acquire_for_write(OAuthStore::File)?;\n    save_oauth_tokens_to_file_with_lock_held(tokens)\n}\n\n/// Updates the fallback File. The caller must hold the File aggregate-store lock.\nfn save_oauth_tokens_to_file_with_lock_held(tokens: &StoredOAuthTokens) -> Result<()> {\n    let key = compute_store_key(&tokens.server_name, &tokens.url)?;\n    let mut store = read_fallback_file_unlocked()?.unwrap_or_default();\n    let executor_owned = tokens.server_name.starts_with(\"executor:\");\n    if executor_owned && store.get(&key).is_some_and(|entry| !entry.executor_owned) {\n        anyhow::bail!(\"executor OAuth credential key conflicts with a host-owned credential\");\n    }\n\n    let token_response = &tokens.token_response.0;\n    let expires_at = tokens\n        .expires_at\n        .or_else(|| compute_expires_at_millis(token_response));\n    let refresh_token = token_response\n        .refresh_token()\n        .map(|token| token.secret().to_string());\n    let scopes = token_response\n        .scopes()\n        .map(|s| s.iter().map(|s| s.to_string()).collect())\n        .unwrap_or_default();\n    let entry = FallbackTokenEntry {\n        server_name: tokens.server_name.clone(),\n        server_url: tokens.url.clone(),\n        issuer: tokens.issuer.clone(),\n        client_id: tokens.client_id.clone(),","sourceCodeStart":855,"sourceCodeEnd":891,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/oauth.rs#L855-L891","documentation":"Error \"executor OAuth credential key conflicts with a host-owned credential\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/oauth.rs:873 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}