fix: support provider-based auth and stabilize cross-machine tests#60
fix: support provider-based auth and stabilize cross-machine tests#60kylezk777 wants to merge 1 commit intoopenai:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cd494b225
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const readinessDetail = selectedProvider.hasProviderConfig | ||
| ? `configured model_provider "${selectedProvider.provider}"${sourceDetail}; login status is not required for this provider` | ||
| : `model_provider "${selectedProvider.provider}" selected${sourceDetail}; login status is not required for this provider`; | ||
| return { | ||
| available: true, |
There was a problem hiding this comment.
Don't treat unconfigured providers as authenticated
This branch marks loggedIn: true for every non-OpenAI model_provider, including cases where hasProviderConfig is false (for example, a typo like model_provider = "litelmm" or a missing [model_providers.*] block). In those scenarios /codex:setup reports ready and skips login guidance, but review/task runs will still fail when Codex validates provider setup. Only bypass codex login status when the provider is known login-free or has usable provider config; otherwise fall back to the existing login check.
Useful? React with 👍 / 👎.
| if (userConfig) { | ||
| candidates.push(userConfig); | ||
| } | ||
| candidates.push(...listProjectConfigFiles(cwd)); |
There was a problem hiding this comment.
Respect project trust before using project config for auth
Project config files are always added to provider resolution, but the plugin docs explicitly note project overrides only apply when the project is trusted. Because this logic has no trust check, an untrusted repo’s .codex/config.toml can force a non-OpenAI provider and make auth appear ready even though Codex CLI may ignore that config and still require OpenAI login. This creates false-positive readiness in /codex:setup and gating flows.
Useful? React with 👍 / 👎.
Summary
providers (for example
litellm).Problem
codex login statusto determine readiness.model_provider = "litellm"),codex login statuscan return “Not logged in” even though the provider config isvalid.
/codex:setupreadiness and review/task flows.What Changed
getCodexLoginStatus:model_provider.detail message.
codex login statuschecks for OpenAI flows.absolute paths.
through.
reduce flaky failures.
Verification
npm test(67/67 passing)node --test tests/runtime.test.mjs(43/43 passing)node --test tests/commands.test.mjs tests/auth-provider.test.mjs tests/ git.test.mjs tests/process.test.mjs tests/state.test.mjs tests/render.test.mjs(22/22 passing)
node --test tests/broker-endpoint.test.mjs(2/2 passing)Notes
reliability.