splash screen (#8270)

# 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.
This commit is contained in:
Ahmed Ibrahim authored and GitHub committed 2025-12-18 10:59:53 -08:00
1 parent b903285746
commit 7157421daa
11 files changed
+81 -71

No files matched your search

@@ -65,12 +65,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "gpt-5.2-codex".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
}),
show_in_picker: true, show_in_picker: true,
supported_in_api: true, supported_in_api: true,
}, },
@@ -92,12 +87,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "gpt-5.2-codex".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
}),
show_in_picker: true, show_in_picker: true,
supported_in_api: true, supported_in_api: true,
}, },
@@ -126,12 +116,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "gpt-5.2-codex".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
}),
show_in_picker: true, show_in_picker: true,
supported_in_api: true, supported_in_api: true,
}, },
@@ -157,12 +142,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "gpt-5.2-codex".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
}),
show_in_picker: false, show_in_picker: false,
supported_in_api: true, supported_in_api: true,
}, },
@@ -183,12 +163,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "gpt-5.1-codex-mini".to_string(),
reasoning_effort_mapping: None,
migration_config_key: HIDE_GPT5_1_MIGRATION_PROMPT_CONFIG.to_string(),
model_link: Some("https://www.codex.com/models/caribou".to_string()),
}),
show_in_picker: false, show_in_picker: false,
supported_in_api: true, supported_in_api: true,
}, },
@@ -214,12 +189,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "caribou".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
}),
show_in_picker: false, show_in_picker: false,
supported_in_api: true, supported_in_api: true,
}, },
@@ -248,12 +218,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "gpt-5.2-codex".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
}),
show_in_picker: false, show_in_picker: false,
supported_in_api: true, supported_in_api: true,
}, },
@@ -278,18 +243,26 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
}, },
], ],
is_default: false, is_default: false,
upgrade: Some(ModelUpgrade { upgrade: Some(gpt_52_codex_upgrade()),
id: "caribou".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "caribou".to_string(),
model_link: Some("https://www.codex.com/models/caribou".to_string()),
}),
show_in_picker: false, show_in_picker: false,
supported_in_api: true, supported_in_api: true,
}, },
] ]
}); });
fn gpt_52_codex_upgrade() -> ModelUpgrade {
ModelUpgrade {
id: "gpt-5.2-codex".to_string(),
reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
upgrade_copy: Some(
"Codex is now powered by gpt-5.2-codex, our latest frontier agentic coding model. It is smarter and faster than its predecessors and capable of long-running project-scale work."
.to_string(),
),
}
}
pub(super) fn builtin_model_presets(_auth_mode: Option<AuthMode>) -> Vec<ModelPreset> { pub(super) fn builtin_model_presets(_auth_mode: Option<AuthMode>) -> Vec<ModelPreset> {
PRESETS PRESETS
.iter() .iter()
+4
View File
@@ -184,6 +184,10 @@ fn gpt52_codex_upgrade() -> codex_protocol::openai_models::ModelUpgrade {
reasoning_effort_mapping: None, reasoning_effort_mapping: None,
migration_config_key: "gpt-5.2-codex".to_string(), migration_config_key: "gpt-5.2-codex".to_string(),
model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()), model_link: Some("https://openai.com/index/introducing-gpt-5-2-codex".to_string()),
upgrade_copy: Some(
"Codex is now powered by gpt-5.2-codex, our latest frontier agentic coding model. It is smarter and faster than its predecessors and capable of long-running project-scale work."
.to_string(),
),
} }
} }
+2
View File
@@ -53,6 +53,7 @@ pub struct ModelUpgrade {
pub reasoning_effort_mapping: Option<HashMap<ReasoningEffort, ReasoningEffort>>, pub reasoning_effort_mapping: Option<HashMap<ReasoningEffort, ReasoningEffort>>,
pub migration_config_key: String, pub migration_config_key: String,
pub model_link: Option<String>, pub model_link: Option<String>,
pub upgrade_copy: Option<String>,
} }
/// Metadata describing a Codex-supported model. /// Metadata describing a Codex-supported model.
@@ -219,6 +220,7 @@ impl From<ModelInfo> for ModelPreset {
migration_config_key: info.slug.clone(), migration_config_key: info.slug.clone(),
// todo(aibrahim): add the model link here. // todo(aibrahim): add the model link here.
model_link: None, model_link: None,
upgrade_copy: None,
}), }),
show_in_picker: info.visibility == ModelVisibility::List, show_in_picker: info.visibility == ModelVisibility::List,
supported_in_api: info.supported_in_api, supported_in_api: info.supported_in_api,
+3
View File
@@ -195,6 +195,7 @@ async fn handle_model_migration_prompt_if_needed(
reasoning_effort_mapping, reasoning_effort_mapping,
migration_config_key, migration_config_key,
model_link, model_link,
upgrade_copy,
}) = upgrade }) = upgrade
{ {
if migration_prompt_hidden(config, migration_config_key.as_str()) { if migration_prompt_hidden(config, migration_config_key.as_str()) {
@@ -227,6 +228,7 @@ async fn handle_model_migration_prompt_if_needed(
model, model,
&target_model, &target_model,
model_link.clone(), model_link.clone(),
upgrade_copy.clone(),
heading_label, heading_label,
target_description, target_description,
can_opt_out, can_opt_out,
@@ -1398,6 +1400,7 @@ mod tests {
reasoning_effort_mapping: None, reasoning_effort_mapping: None,
migration_config_key: HIDE_GPT5_1_MIGRATION_PROMPT_CONFIG.to_string(), migration_config_key: HIDE_GPT5_1_MIGRATION_PROMPT_CONFIG.to_string(),
model_link: None, model_link: None,
upgrade_copy: None,
}); });
available.retain(|preset| preset.model != "gpt-5-codex"); available.retain(|preset| preset.model != "gpt-5-codex");
available.push(current.clone()); available.push(current.clone());
+33 -14
View File
@@ -59,26 +59,36 @@ pub(crate) fn migration_copy_for_models(
current_model: &str, current_model: &str,
target_model: &str, target_model: &str,
model_link: Option<String>, model_link: Option<String>,
migration_copy: Option<String>,
target_display_name: String, target_display_name: String,
target_description: Option<String>, target_description: Option<String>,
can_opt_out: bool, can_opt_out: bool,
) -> ModelMigrationCopy { ) -> ModelMigrationCopy {
let heading_text = Span::from(format!("Try {target_display_name}")).bold(); let heading_text = Span::from(format!(
let description_line = target_description "Codex just got an upgrade. Introducing {target_display_name}."
.filter(|desc| !desc.is_empty()) ))
.map(Line::from) .bold();
.unwrap_or_else(|| { let description_line: Line<'static>;
Line::from(format!( if let Some(migration_copy) = &migration_copy {
"{target_display_name} is recommended for better performance and reliability." description_line = Line::from(migration_copy.clone());
)) } else {
}); description_line = target_description
.filter(|desc| !desc.is_empty())
.map(Line::from)
.unwrap_or_else(|| {
Line::from(format!(
"{target_display_name} is recommended for better performance and reliability."
))
});
}
let mut content = vec![ let mut content = vec![];
Line::from(format!( if migration_copy.is_none() {
content.push(Line::from(format!(
"We recommend switching from {current_model} to {target_model}." "We recommend switching from {current_model} to {target_model}."
)), )));
Line::from(""), content.push(Line::from(""));
]; }
if let Some(model_link) = model_link { if let Some(model_link) = model_link {
content.push(Line::from(vec![ content.push(Line::from(vec![
@@ -364,6 +374,10 @@ mod tests {
"gpt-5.1-codex-mini", "gpt-5.1-codex-mini",
"gpt-5.1-codex-max", "gpt-5.1-codex-max",
None, None,
Some(
"Upgrade to gpt-5.2-codex for the latest and greatest agentic coding model."
.to_string(),
),
"gpt-5.1-codex-max".to_string(), "gpt-5.1-codex-max".to_string(),
Some("Codex-optimized flagship for deep and fast reasoning.".to_string()), Some("Codex-optimized flagship for deep and fast reasoning.".to_string()),
true, true,
@@ -391,6 +405,7 @@ mod tests {
"gpt-5", "gpt-5",
"gpt-5.1", "gpt-5.1",
Some("https://www.codex.com/models/gpt-5.1".to_string()), Some("https://www.codex.com/models/gpt-5.1".to_string()),
None,
"gpt-5.1".to_string(), "gpt-5.1".to_string(),
Some("Broad world knowledge with strong general reasoning.".to_string()), Some("Broad world knowledge with strong general reasoning.".to_string()),
false, false,
@@ -416,6 +431,7 @@ mod tests {
"gpt-5-codex", "gpt-5-codex",
"gpt-5.1-codex-max", "gpt-5.1-codex-max",
Some("https://www.codex.com/models/gpt-5.1-codex-max".to_string()), Some("https://www.codex.com/models/gpt-5.1-codex-max".to_string()),
None,
"gpt-5.1-codex-max".to_string(), "gpt-5.1-codex-max".to_string(),
Some("Codex-optimized flagship for deep and fast reasoning.".to_string()), Some("Codex-optimized flagship for deep and fast reasoning.".to_string()),
false, false,
@@ -441,6 +457,7 @@ mod tests {
"gpt-5-codex-mini", "gpt-5-codex-mini",
"gpt-5.1-codex-mini", "gpt-5.1-codex-mini",
Some("https://www.codex.com/models/gpt-5.1-codex-mini".to_string()), Some("https://www.codex.com/models/gpt-5.1-codex-mini".to_string()),
None,
"gpt-5.1-codex-mini".to_string(), "gpt-5.1-codex-mini".to_string(),
Some("Optimized for codex. Cheaper, faster, but less capable.".to_string()), Some("Optimized for codex. Cheaper, faster, but less capable.".to_string()),
false, false,
@@ -462,6 +479,7 @@ mod tests {
"gpt-old", "gpt-old",
"gpt-new", "gpt-new",
Some("https://www.codex.com/models/gpt-new".to_string()), Some("https://www.codex.com/models/gpt-new".to_string()),
None,
"gpt-new".to_string(), "gpt-new".to_string(),
Some("Latest recommended model for better performance.".to_string()), Some("Latest recommended model for better performance.".to_string()),
true, true,
@@ -489,6 +507,7 @@ mod tests {
"gpt-old", "gpt-old",
"gpt-new", "gpt-new",
Some("https://www.codex.com/models/gpt-new".to_string()), Some("https://www.codex.com/models/gpt-new".to_string()),
None,
"gpt-new".to_string(), "gpt-new".to_string(),
Some("Latest recommended model for better performance.".to_string()), Some("Latest recommended model for better performance.".to_string()),
true, true,
+11
View File
@@ -11,6 +11,15 @@ pub(crate) fn selection_option_row(
index: usize, index: usize,
label: String, label: String,
is_selected: bool, is_selected: bool,
) -> Box<dyn Renderable> {
selection_option_row_with_dim(index, label, is_selected, false)
}
pub(crate) fn selection_option_row_with_dim(
index: usize,
label: String,
is_selected: bool,
dim: bool,
) -> Box<dyn Renderable> { ) -> Box<dyn Renderable> {
let prefix = if is_selected { let prefix = if is_selected {
format!("› {}. ", index + 1) format!("› {}. ", index + 1)
@@ -19,6 +28,8 @@ pub(crate) fn selection_option_row(
}; };
let style = if is_selected { let style = if is_selected {
Style::default().cyan() Style::default().cyan()
} else if dim {
Style::default().dim()
} else { } else {
Style::default() Style::default()
}; };
@@ -3,12 +3,10 @@ source: tui/src/model_migration.rs
expression: terminal.backend() expression: terminal.backend()
--- ---
> Try gpt-5.1-codex-max > Codex just got an upgrade. Introducing gpt-5.1-codex-max.
We recommend switching from gpt-5.1-codex-mini to Upgrade to gpt-5.2-codex for the latest and greatest
gpt-5.1-codex-max. agentic coding model.
Codex-optimized flagship for deep and fast reasoning.
You can continue using gpt-5.1-codex-mini if you prefer. You can continue using gpt-5.1-codex-mini if you prefer.
@@ -3,7 +3,7 @@ source: tui/src/model_migration.rs
expression: terminal.backend() expression: terminal.backend()
--- ---
> Try gpt-5.1-codex-max > Codex just got an upgrade. Introducing gpt-5.1-codex-max.
We recommend switching from gpt-5-codex to We recommend switching from gpt-5-codex to
gpt-5.1-codex-max. gpt-5.1-codex-max.
@@ -3,7 +3,7 @@ source: tui/src/model_migration.rs
expression: terminal.backend() expression: terminal.backend()
--- ---
> Try gpt-5.1-codex-mini > Codex just got an upgrade. Introducing gpt-5.1-codex-mini.
We recommend switching from gpt-5-codex-mini to We recommend switching from gpt-5-codex-mini to
gpt-5.1-codex-mini. gpt-5.1-codex-mini.
@@ -3,7 +3,7 @@ source: tui/src/model_migration.rs
expression: terminal.backend() expression: terminal.backend()
--- ---
> Try gpt-5.1 > Codex just got an upgrade. Introducing gpt-5.1.
We recommend switching from gpt-5 to gpt-5.1. We recommend switching from gpt-5 to gpt-5.1.
+1 -1
View File
@@ -214,7 +214,7 @@ async fn handle_model_migration_prompt_if_needed(
id: target_model, id: target_model,
reasoning_effort_mapping, reasoning_effort_mapping,
migration_config_key, migration_config_key,
model_link: _, ..
}) = upgrade }) = upgrade
{ {
if migration_prompt_hidden(config, migration_config_key.as_str()) { if migration_prompt_hidden(config, migration_config_key.as_str()) {