{"record":{"id":"50c3a1f8b8a235b1","repo":"Hmbown/CodeWhale","slug":"codex-oauth-credentials-are-only-available-on-the","errorCode":null,"errorMessage":"Codex OAuth credentials are only available on the official OpenAI Codex route","messagePattern":"Codex OAuth credentials are only available on the official OpenAI Codex route","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":10821,"sourceCode":"    // Last resort: the user-global config file. A key saved there must not\n    // disappear just because this process loaded a workspace config.\n    if user_global_config_api_key(provider).is_some() {\n        return true;\n    }\n\n    false\n}\n\nimpl Config {\n    /// Resolve one coherent Codex OAuth snapshot. The bearer and account id\n    /// must come from the same secure file handle; opening the external JSON a\n    /// second time could pair identities across an atomic owner refresh or a\n    /// hostile path swap.\n    pub(crate) fn codex_credentials(&self) -> Result<crate::oauth::CodexCredentials> {\n        if let Some(credentials) = crate::oauth::credentials_from_env() {\n            return Ok(credentials);\n        }\n        anyhow::ensure!(\n            self.api_provider() == ApiProvider::OpenaiCodex\n                && !self.provider_uses_custom_endpoint(ApiProvider::OpenaiCodex),\n            \"Codex OAuth credentials are only available on the official OpenAI Codex route\"\n        );\n        let path = crate::oauth::auth_file_path();\n        let grant = self.external_credential_read_grant(\n            ApiProvider::OpenaiCodex,\n            codewhale_config::ExternalCredentialSource::CodexCli,\n            &path,\n        )?;\n        crate::oauth::get_credentials(&grant)\n    }\n\n    /// ChatGPT account id for the already-selected Codex route. Environment\n    /// metadata remains independent; the external file is read only when the\n    /// exact provider/source/path consent tuple is valid.\n    #[cfg(test)]\n    pub(crate) fn codex_account_id(&self) -> Option<String> {","sourceCodeStart":10803,"sourceCodeEnd":10839,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/config.rs#L10803-L10839","documentation":"Error \"Codex OAuth credentials are only available on the official OpenAI Codex route\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/config.rs:10821 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":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}