Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions codex-rs/tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,15 @@ impl App {
fn show_model_save_hint(&mut self) {
let model = self.config.model.clone();
if self.active_profile.is_some() {
self.chat_widget.add_info_message(format!(
"Model switched to {model}. Press Ctrl+S to save it for this profile, then press Ctrl+S again to set it as your global default."
));
self.chat_widget.add_info_message(
format!("Model changed to {model} for the current session"),
Some("(ctrl+s to set as profile default)".to_string()),
);
} else {
self.chat_widget.add_info_message(format!(
"Model switched to {model}. Press Ctrl+S to save it as your global default."
));
self.chat_widget.add_info_message(
format!("Model changed to {model} for the current session"),
Some("(ctrl+s to set as default)".to_string()),
);
}
}

Expand Down Expand Up @@ -372,19 +374,17 @@ impl App {

let model = self.config.model.clone();
let effort = self.config.model_reasoning_effort;
let effort_label = effort
.map(|effort| effort.to_string())
.unwrap_or_else(|| "none".to_string());
let codex_home = self.config.codex_home.clone();

match scope {
SaveScope::Profile(profile) => {
match persist_model_selection(&codex_home, Some(profile), &model, effort).await {
Ok(()) => {
self.model_saved_to_profile = true;
self.chat_widget.add_info_message(format!(
"Saved model {model} ({effort_label}) for profile `{profile}`. Press Ctrl+S again to make this your global default."
));
self.chat_widget.add_info_message(
format!("Profile model changed to {model} for all sessions"),
Some("(view global config in config.toml)".to_string()),
);
}
Err(err) => {
tracing::error!(
Expand All @@ -401,9 +401,10 @@ impl App {
match persist_model_selection(&codex_home, None, &model, effort).await {
Ok(()) => {
self.model_saved_to_global = true;
self.chat_widget.add_info_message(format!(
"Saved model {model} ({effort_label}) as your global default."
));
self.chat_widget.add_info_message(
format!("Default model changed to {model} for all sessions"),
Some("(view global config in config.toml)".to_string()),
)
}
Err(err) => {
tracing::error!(
Expand All @@ -420,6 +421,7 @@ impl App {
self.chat_widget.add_info_message(
"Model preference already saved globally; no further action needed."
.to_string(),
None,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions codex-rs/tui/src/chatwidget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,8 @@ impl ChatWidget {
self.config.model = model;
}

pub(crate) fn add_info_message(&mut self, message: String) {
self.add_to_history(history_cell::new_info_event(message));
pub(crate) fn add_info_message(&mut self, message: String, hint: Option<String>) {
self.add_to_history(history_cell::new_info_event(message, hint));
self.request_redraw();
}

Expand Down
10 changes: 7 additions & 3 deletions codex-rs/tui/src/history_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,13 @@ pub(crate) fn new_mcp_tools_output(
PlainHistoryCell { lines }
}

pub(crate) fn new_info_event(message: String) -> PlainHistoryCell {
let lines: Vec<Line<'static>> =
vec![vec![padded_emoji("💾").green(), " ".into(), message.into()].into()];
pub(crate) fn new_info_event(message: String, hint: Option<String>) -> PlainHistoryCell {
let mut line = vec!["> ".into(), message.into()];
if let Some(hint) = hint {
line.push(" ".into());
line.push(hint.dark_gray());
}
let lines: Vec<Line<'static>> = vec![line.into()];
PlainHistoryCell { lines }
}

Expand Down
10 changes: 6 additions & 4 deletions codex-rs/tui/src/new_model_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ impl WidgetRef for &ModelUpgradePopup {
Clear.render(area, buf);

let mut lines: Vec<Line> = vec![
String::new().into(),
format!(" Codex is now powered by {GPT5_HIGH_MODEL}, a new model that is").into(),
Line::from(vec![
"> ".into(),
format!("Try {GPT5_HIGH_MODEL} as your default model").bold(),
" ".into(),
"faster, a better collaborator, ".bold(),
"and ".into(),
"more steerable.".bold(),
]),
format!(" {GPT5_HIGH_MODEL} is our latest model tuned for coding workflows.").into(),
" Switch now or keep your current default – you can change models any time.".into(),
"".into(),
];

Expand Down
Loading