mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:22:05 +00:00
copy for model migration nudge (#6585)
This commit is contained in:
1 parent
e3aaee00c8
commit
305fe73d83
7 files changed
+15
-24
No files matched your search
@@ -84,7 +84,7 @@ async fn handle_model_migration_prompt_if_needed(
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
match run_model_migration_prompt(tui, &target_model).await {
|
match run_model_migration_prompt(tui).await {
|
||||||
ModelMigrationOutcome::Accepted => {
|
ModelMigrationOutcome::Accepted => {
|
||||||
app_event_tx.send(AppEvent::PersistModelMigrationPromptAcknowledged {
|
app_event_tx.send(AppEvent::PersistModelMigrationPromptAcknowledged {
|
||||||
migration_config: "hide_gpt5_1_migration_prompt".to_string(),
|
migration_config: "hide_gpt5_1_migration_prompt".to_string(),
|
||||||
|
|||||||
@@ -1856,7 +1856,7 @@ impl ChatWidget {
|
|||||||
self.bottom_pane.show_selection_view(SelectionViewParams {
|
self.bottom_pane.show_selection_view(SelectionViewParams {
|
||||||
title: Some("Select Model and Effort".to_string()),
|
title: Some("Select Model and Effort".to_string()),
|
||||||
subtitle: Some(
|
subtitle: Some(
|
||||||
"Access legacy models by running codex -m <model_name> or in your config"
|
"Access legacy models by running codex -m <model_name> or in your config.toml"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
footer_hint: Some("Press enter to select reasoning effort, or esc to dismiss.".into()),
|
footer_hint: Some("Press enter to select reasoning effort, or esc to dismiss.".into()),
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ source: tui/src/chatwidget/tests.rs
|
|||||||
expression: popup
|
expression: popup
|
||||||
---
|
---
|
||||||
Select Model and Effort
|
Select Model and Effort
|
||||||
Access legacy models by running codex -m <model_name> or in your config
|
Access legacy models by running codex -m <model_name> or in your config.toml
|
||||||
|
|
||||||
› 1. gpt-5.1-codex Optimized for codex.
|
› 1. gpt-5.1-codex Optimized for codex.
|
||||||
2. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less
|
2. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but less
|
||||||
|
|||||||
@@ -24,10 +24,7 @@ pub(crate) enum ModelMigrationOutcome {
|
|||||||
Exit,
|
Exit,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn run_model_migration_prompt(
|
pub(crate) async fn run_model_migration_prompt(tui: &mut Tui) -> ModelMigrationOutcome {
|
||||||
tui: &mut Tui,
|
|
||||||
target_model: &str,
|
|
||||||
) -> ModelMigrationOutcome {
|
|
||||||
// Render the prompt on the terminal's alternate screen so exiting or cancelling
|
// Render the prompt on the terminal's alternate screen so exiting or cancelling
|
||||||
// does not leave a large blank region in the normal scrollback. This does not
|
// does not leave a large blank region in the normal scrollback. This does not
|
||||||
// change the prompt's appearance – only where it is drawn.
|
// change the prompt's appearance – only where it is drawn.
|
||||||
@@ -48,7 +45,7 @@ pub(crate) async fn run_model_migration_prompt(
|
|||||||
|
|
||||||
let alt = AltScreenGuard::enter(tui);
|
let alt = AltScreenGuard::enter(tui);
|
||||||
|
|
||||||
let mut screen = ModelMigrationScreen::new(alt.tui.frame_requester(), target_model);
|
let mut screen = ModelMigrationScreen::new(alt.tui.frame_requester());
|
||||||
|
|
||||||
let _ = alt.tui.draw(u16::MAX, |frame| {
|
let _ = alt.tui.draw(u16::MAX, |frame| {
|
||||||
frame.render_widget_ref(&screen, frame.area());
|
frame.render_widget_ref(&screen, frame.area());
|
||||||
@@ -79,16 +76,14 @@ pub(crate) async fn run_model_migration_prompt(
|
|||||||
|
|
||||||
struct ModelMigrationScreen {
|
struct ModelMigrationScreen {
|
||||||
request_frame: FrameRequester,
|
request_frame: FrameRequester,
|
||||||
target_model: String,
|
|
||||||
done: bool,
|
done: bool,
|
||||||
should_exit: bool,
|
should_exit: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ModelMigrationScreen {
|
impl ModelMigrationScreen {
|
||||||
fn new(request_frame: FrameRequester, target_model: &str) -> Self {
|
fn new(request_frame: FrameRequester) -> Self {
|
||||||
Self {
|
Self {
|
||||||
request_frame,
|
request_frame,
|
||||||
target_model: target_model.to_string(),
|
|
||||||
done: false,
|
done: false,
|
||||||
should_exit: false,
|
should_exit: false,
|
||||||
}
|
}
|
||||||
@@ -140,10 +135,7 @@ impl WidgetRef for &ModelMigrationScreen {
|
|||||||
column.push("");
|
column.push("");
|
||||||
column.push(Line::from(vec![
|
column.push(Line::from(vec![
|
||||||
"> ".into(),
|
"> ".into(),
|
||||||
"Introducing ".bold(),
|
"Introducing our gpt-5.1 models".bold(),
|
||||||
"our ".bold(),
|
|
||||||
self.target_model.clone().bold(),
|
|
||||||
" models".bold(),
|
|
||||||
]));
|
]));
|
||||||
column.push(Line::from(""));
|
column.push(Line::from(""));
|
||||||
|
|
||||||
@@ -199,7 +191,7 @@ mod tests {
|
|||||||
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
||||||
terminal.set_viewport_area(Rect::new(0, 0, width, height));
|
terminal.set_viewport_area(Rect::new(0, 0, width, height));
|
||||||
|
|
||||||
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1-codex");
|
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut frame = terminal.get_frame();
|
let mut frame = terminal.get_frame();
|
||||||
@@ -216,7 +208,7 @@ mod tests {
|
|||||||
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
||||||
terminal.set_viewport_area(Rect::new(0, 0, 65, 12));
|
terminal.set_viewport_area(Rect::new(0, 0, 65, 12));
|
||||||
|
|
||||||
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1");
|
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());
|
||||||
{
|
{
|
||||||
let mut frame = terminal.get_frame();
|
let mut frame = terminal.get_frame();
|
||||||
frame.render_widget_ref(&screen, frame.area());
|
frame.render_widget_ref(&screen, frame.area());
|
||||||
@@ -231,7 +223,7 @@ mod tests {
|
|||||||
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
||||||
terminal.set_viewport_area(Rect::new(0, 0, 60, 12));
|
terminal.set_viewport_area(Rect::new(0, 0, 60, 12));
|
||||||
|
|
||||||
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1-codex");
|
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());
|
||||||
{
|
{
|
||||||
let mut frame = terminal.get_frame();
|
let mut frame = terminal.get_frame();
|
||||||
frame.render_widget_ref(&screen, frame.area());
|
frame.render_widget_ref(&screen, frame.area());
|
||||||
@@ -246,7 +238,7 @@ mod tests {
|
|||||||
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
let mut terminal = Terminal::with_options(backend).expect("terminal");
|
||||||
terminal.set_viewport_area(Rect::new(0, 0, 60, 12));
|
terminal.set_viewport_area(Rect::new(0, 0, 60, 12));
|
||||||
|
|
||||||
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1-codex-mini");
|
let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());
|
||||||
{
|
{
|
||||||
let mut frame = terminal.get_frame();
|
let mut frame = terminal.get_frame();
|
||||||
frame.render_widget_ref(&screen, frame.area());
|
frame.render_widget_ref(&screen, frame.area());
|
||||||
@@ -257,8 +249,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn escape_key_accepts_prompt() {
|
fn escape_key_accepts_prompt() {
|
||||||
let screen_target = "gpt-5.1-codex";
|
let mut screen = ModelMigrationScreen::new(FrameRequester::test_dummy());
|
||||||
let mut screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), screen_target);
|
|
||||||
|
|
||||||
// Simulate pressing Escape
|
// Simulate pressing Escape
|
||||||
screen.handle_key(KeyEvent::new(
|
screen.handle_key(KeyEvent::new(
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
source: tui/src/model_migration.rs
|
source: tui/src/model_migration.rs
|
||||||
expression: terminal.backend()
|
expression: terminal.backend()
|
||||||
---
|
---
|
||||||
> Introducing our gpt-5.1-codex models
|
> Introducing our gpt-5.1 models
|
||||||
|
|
||||||
We've upgraded our family of models supported in Codex to
|
We've upgraded our family of models supported in Codex to
|
||||||
gpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.
|
gpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
source: tui/src/model_migration.rs
|
source: tui/src/model_migration.rs
|
||||||
expression: terminal.backend()
|
expression: terminal.backend()
|
||||||
---
|
---
|
||||||
> Introducing our gpt-5.1-codex models
|
> Introducing our gpt-5.1 models
|
||||||
|
|
||||||
We've upgraded our family of models supported in Codex to
|
We've upgraded our family of models supported in Codex to
|
||||||
gpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.
|
gpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
source: tui/src/model_migration.rs
|
source: tui/src/model_migration.rs
|
||||||
expression: terminal.backend()
|
expression: terminal.backend()
|
||||||
---
|
---
|
||||||
> Introducing our gpt-5.1-codex-mini models
|
> Introducing our gpt-5.1 models
|
||||||
|
|
||||||
We've upgraded our family of models supported in Codex to
|
We've upgraded our family of models supported in Codex to
|
||||||
gpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.
|
gpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.
|
||||||
|
|||||||
Reference in new issue
Block a user