-
Notifications
You must be signed in to change notification settings - Fork 7.4k
fix(config): allow user-defined providers to override built-in providers #8670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(config): allow user-defined providers to override built-in providers #8670
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80b117cfeb
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
For the record, my main apprehension with this change is that while the built-in definition for codex/codex-rs/core/src/model_provider_info.rs Lines 320 to 336 in ac2090c
The built-in definition for the codex/codex-rs/core/src/model_provider_info.rs Lines 220 to 258 in ac2090c
For Similarly, we currently honor the That said, I don't love the environment variables. Would it be more attractive to add support for /cc @etraut-openai who I think was also hoping to eliminate support for |
|
@bolinfest your concern about openai complexity makes sense. For the ollama case in #8240, users just need to point at a remote server - they shouldn't have to know about all the internal fields. Thoughts:
Happy to go whichever direction you prefer. The *_base_url config options seem like the simplest path if the goal is just enabling remote servers without exposing the full provider complexty. |
Fixes #8240
When users define a model provider in
config.tomlwith the same name as a built-in provider (e.g.,ollama), the user's configuration should override the built-in defaults. Previously,or_insertwas used which only inserted if the key didn't exist, causing user-definedbase_urlvalues to be ignored for built-in provider names.Changed to
insertso user-defined providers properly override built-in ones.Added a regression test to verify the fix.