-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Introduce ModelsManager and migrate app-server to use it.
#7552
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".
| pub async fn list_models(&self) -> Vec<ModelPreset> { | ||
| self.models_manager.available_models.clone() | ||
| } |
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.
ListModels caches initial auth mode
ConversationManager::list_models() simply clones models_manager.available_models, which is built once in ConversationManager::new using the auth mode present at startup. There is no refresh when the auth state changes, so if the process starts unauthenticated and the user later logs in with an API key (or switches auth modes), ModelList responses continue to return the initial preset set (e.g., still exposing gpt-5.1-codex-max to API-key users) until restart. The model list should be computed from the current auth mode instead of a startup snapshot.
Useful? React with 👍 / 👎.
|
|
||
| impl ModelsManager { | ||
| pub fn new(auth_mode: Option<AuthMode>) -> Self { | ||
| std::thread::sleep(Duration::from_secs(1)); |
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.
I think there should be an async method load models and we should async sleep there
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.
Or remove completely for now
pakrym-oai
left a comment
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.
Remove the sleep
No description provided.