-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add remote models feature flag #7648
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
Conversation
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.
ℹ️ 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".
codex-rs/core/src/features.rs
Outdated
| /// Refresh remote models and emit AppReady once the list is available. | ||
| RemoteModels, | ||
| /// Refresh remote models and emit AppReady once the list is available. | ||
| RemoteModels, |
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.
| let response = client | ||
| .list_models(env!("CARGO_PKG_VERSION"), HeaderMap::new()) | ||
| .list_models("99.99.99", HeaderMap::new()) | ||
| .await |
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.
Use real client version when listing models
refresh_available_models now calls list_models with a hard-coded version string "99.99.99" instead of the actual package version. When the server filters models by minimum client version, this misreports the client as much newer, so incompatible models may be returned (or telemetry becomes inaccurate) even though the client code has not been upgraded.
Useful? React with 👍 / 👎.
|
@codex review this |
codex-rs/core/src/codex.rs
Outdated
|
|
||
| /// Persist the event to rollout and send it to clients. | ||
| pub(crate) async fn send_event(&self, turn_context: &TurnContext, msg: EventMsg) { | ||
| pub(crate) async fn send_event(&self, sub_id: &str, msg: EventMsg) { |
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.
this was intentionally taking turn_context: &TurnContext to later be able to emit events with turn_id, in addition to submtion id. Is this change necessary?
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.
no old changes polluted that
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.
ℹ️ 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".
| let response = client | ||
| .list_models(env!("CARGO_PKG_VERSION"), HeaderMap::new()) | ||
| .list_models("99.99.99", HeaderMap::new()) | ||
| .await |
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.
Misreports client version when fetching remote models
The new RemoteModels refresh hard-codes the client version as "99.99.99" when calling list_models, whereas before it sent the actual build version. This tells the server we support the latest capabilities, so it will return models whose minimal_client_version might exceed what this client actually implements. With the flag enabled we cache that list and promote the highest-priority model to default, which can expose users to models the client cannot handle (e.g., incompatible shell types or missing features), leading to runtime failures once selected.
Useful? React with 👍 / 👎.
codex-rs/core/src/codex.rs
Outdated
| info!("Turn error: {e:#}"); | ||
| let event = EventMsg::Error(e.to_error_event(None)); | ||
| sess.send_event(&turn_context, event).await; | ||
| sess.send_event(turn_context.as_ref(), event).await; |
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.
nit: use &
| .refresh_available_models(&config.model_provider) | ||
| .await | ||
| { | ||
| error!("failed to refresh available models: {err}"); |
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.
Can we test the fact that we are loading models?
External (non-OpenAI) Pull Request Requirements
Before opening this Pull Request, please read the dedicated "Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md
If your PR conforms to our contribution guidelines, replace this text with a detailed and high quality description of your changes.
Include a link to a bug report or enhancement request.