Migrate codex max (#7566)

- make codex max the default
- fix: we were doing some async work in sync function which caused tui
to panic
This commit is contained in:
Ahmed Ibrahim
2025-12-03 20:54:48 -08:00
committed by GitHub
Unverified
parent edd98dd3b7
commit 67e67e054f
6 changed files with 29 additions and 33 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ use tokio::sync::mpsc::unbounded_channel;
use crate::history_cell::UpdateAvailableHistoryCell;
const GPT_5_1_MIGRATION_AUTH_MODES: [AuthMode; 2] = [AuthMode::ChatGPT, AuthMode::ApiKey];
const GPT_5_1_CODEX_MIGRATION_AUTH_MODES: [AuthMode; 1] = [AuthMode::ChatGPT];
const GPT_5_1_CODEX_MIGRATION_AUTH_MODES: [AuthMode; 2] = [AuthMode::ChatGPT, AuthMode::ApiKey];
#[derive(Debug, Clone)]
pub struct AppExitInfo {
@@ -1438,7 +1438,7 @@ mod tests {
Some(AuthMode::ChatGPT),
HIDE_GPT_5_1_CODEX_MAX_MIGRATION_PROMPT_CONFIG,
));
assert!(!migration_prompt_allows_auth_mode(
assert!(migration_prompt_allows_auth_mode(
Some(AuthMode::ApiKey),
HIDE_GPT_5_1_CODEX_MAX_MIGRATION_PROMPT_CONFIG,
));
+12 -8
View File
@@ -2031,7 +2031,7 @@ impl ChatWidget {
}
fn lower_cost_preset(&self) -> Option<ModelPreset> {
let models = self.models_manager.available_models.blocking_read();
let models = self.models_manager.available_models.try_read().ok()?;
models
.iter()
.find(|preset| preset.model == NUDGE_MODEL_SLUG)
@@ -2138,13 +2138,17 @@ impl ChatWidget {
/// a second popup is shown to choose the reasoning effort.
pub(crate) fn open_model_popup(&mut self) {
let current_model = self.config.model.clone();
let presets: Vec<ModelPreset> = self
.models_manager
.available_models
.blocking_read()
.iter()
.cloned()
.collect();
let presets: Vec<ModelPreset> =
// todo(aibrahim): make this async function
if let Ok(models) = self.models_manager.available_models.try_read() {
models.clone()
} else {
self.add_info_message(
"Models are being updated; please try /model again in a moment.".to_string(),
None,
);
return;
};
let mut items: Vec<SelectionItem> = Vec::new();
for preset in presets.into_iter() {
@@ -5,9 +5,11 @@ expression: popup
Select Model and Effort
Access legacy models by running codex -m <model_name> or in your config.toml
1. gpt-5.1-codex Optimized for codex.
2. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less
1. gpt-5.1-codex-max Latest Codex-optimized flagship for deep and fast
reasoning.
2. gpt-5.1-codex Optimized for codex.
3. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less
capable.
3. gpt-5.1 Broad world knowledge with strong general reasoning.
4. gpt-5.1 Broad world knowledge with strong general reasoning.
Press enter to select reasoning effort, or esc to dismiss.