fix: skip auth check custom model providers#787
Conversation
When the Codex CLI is configured with a custom model_provider in ~/.codex/config.toml (e.g. Portkey, Azure OpenAI proxy), authentication is handled via provider-specific environment variables rather than `codex login`. The `codex login status` probe would report 'not logged in' and t3code would treat this as a blocking error, even though the CLI works perfectly fine. This change reads the model_provider key from the Codex CLI config file at startup. When a non-OpenAI provider is detected, the auth probe is skipped and the provider health check returns ready with authStatus 'unknown' instead of erroring out. Fixes #644
…p-auth-check-custom-model-providers Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@juliusmarminge maintainer edits are enabled. Reached out on X. |
i had checked something out in a weird state. works now |
was unable to push to #649 cc @binbandit do you have maintainer edits enabled?
What Changed
Why
UI Changes
Checklist
Note
Medium Risk
Changes server startup provider-health logic to conditionally bypass the
codex login statuscheck based on local config parsing, which could alter readiness reporting if the config scan mis-detectsmodel_provider. Test coverage is expanded to reduce regressions, but behavior now depends on filesystem/env state (CODEX_HOME).Overview
Updates the Codex provider health check to detect
model_providerfromconfig.toml(via$CODEX_HOMEor~/.codex) and skip thecodex login statusauth probe when a non-OpenAI provider is configured, returningreadywithauthStatus: unknownand a clear message.Adds extensive tests that create a temporary
CODEX_HOMEto validate the new config scanning (readCodexConfigModelProvider,hasCustomModelProvider) and to cover both paths: custom providers (auth probe skipped) vsopenai(auth probe still enforced), plus additionalparseAuthStatusFromOutputcases.Written by Cursor Bugbot for commit 7333863. This will update automatically on new commits. Configure here.
Note
Skip OpenAI auth probe in
checkCodexProviderStatuswhen a custom model provider is configuredreadCodexConfigModelProviderto parse themodel_providerkey from$CODEX_HOME/config.toml(falling back to~/.codex/config.toml), ignoring comments, blank lines, and section-scoped keys.hasCustomModelProviderwhich returnstruewhen the configured provider is notopenai.checkCodexProviderStatusskips thecodex login statusprobe and returnsavailable: truewithauthStatus: 'unknown'and an explanatory message; behavior for OpenAI is unchanged.withTempCodexHomehelper to isolateCODEX_HOMEper test.Macroscope summarized 7333863.