Skip to content

fix: skip auth check custom model providers#787

Closed
juliusmarminge wants to merge 2 commits intomainfrom
t3code/pr-649/fix/skip-auth-check-custom-model-providers
Closed

fix: skip auth check custom model providers#787
juliusmarminge wants to merge 2 commits intomainfrom
t3code/pr-649/fix/skip-auth-check-custom-model-providers

Conversation

@juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Mar 10, 2026

was unable to push to #649 cc @binbandit do you have maintainer edits enabled?

What Changed

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Changes server startup provider-health logic to conditionally bypass the codex login status check based on local config parsing, which could alter readiness reporting if the config scan mis-detects model_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_provider from config.toml (via $CODEX_HOME or ~/.codex) and skip the codex login status auth probe when a non-OpenAI provider is configured, returning ready with authStatus: unknown and a clear message.

Adds extensive tests that create a temporary CODEX_HOME to validate the new config scanning (readCodexConfigModelProvider, hasCustomModelProvider) and to cover both paths: custom providers (auth probe skipped) vs openai (auth probe still enforced), plus additional parseAuthStatusFromOutput cases.

Written by Cursor Bugbot for commit 7333863. This will update automatically on new commits. Configure here.

Note

Skip OpenAI auth probe in checkCodexProviderStatus when a custom model provider is configured

  • Adds readCodexConfigModelProvider to parse the model_provider key from $CODEX_HOME/config.toml (falling back to ~/.codex/config.toml), ignoring comments, blank lines, and section-scoped keys.
  • Adds hasCustomModelProvider which returns true when the configured provider is not openai.
  • When a custom provider is detected, checkCodexProviderStatus skips the codex login status probe and returns available: true with authStatus: 'unknown' and an explanatory message; behavior for OpenAI is unchanged.
  • Adds tests covering config parsing, provider detection, and the updated health-check flow, using a withTempCodexHome helper to isolate CODEX_HOME per test.

Macroscope summarized 7333863.

binbandit and others added 2 commits March 9, 2026 20:44
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>
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 12a4658d-876b-4ac0-83d0-96903a19c62e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch t3code/pr-649/fix/skip-auth-check-custom-model-providers

Comment @coderabbitai help to get the list of available commands and usage tips.

@juliusmarminge juliusmarminge changed the title T3code/pr 649/fix/skip auth check custom model providers fix: skip auth check custom model providers Mar 10, 2026
@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 10, 2026
@binbandit
Copy link
Contributor

@juliusmarminge maintainer edits are enabled. Reached out on X.
Lets work something out, as im looking to contribute more, and dont want this stuff to be a blocker for either of us moving forward

@juliusmarminge
Copy link
Member Author

@juliusmarminge maintainer edits are enabled. Reached out on X. Lets work something out, as im looking to contribute more, and dont want this stuff to be a blocker for either of us moving forward

i had checked something out in a weird state. works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants