mirror of
https://github.com/openai/codex.git
synced 2026-05-02 18:37:01 +00:00
Enable model upgrade popup even when selected model is no longer in picker (#8802)
With `config.toml`: ``` model = "gpt-5.1-codex" ``` (where `gpt-5.1-codex` has `show_in_picker: false` in [`model_presets.rs`](https://github.com/openai/codex/blob/main/codex-rs/core/src/models_manager/model_presets.rs); this happens if the user hasn't used codex in a while so they didn't see the popup before their model was changed to `show_in_picker: false`) The upgrade picker used to not show (because `gpt-5.1-codex` was filtered out of the model list in code). Now, the filtering is done downstream in tui and app-server, so the model upgrade popup shows: <img width="1503" height="227" alt="Screenshot 2026-01-06 at 5 04 37 PM" src="https://github.com/user-attachments/assets/26144cc2-0b3f-4674-ac17-e476781ec548" />
This commit is contained in:
@@ -11,6 +11,7 @@ use codex_core::config::Config;
|
||||
use codex_core::config::ConfigBuilder;
|
||||
use codex_core::config::Constrained;
|
||||
use codex_core::config::ConstraintError;
|
||||
use codex_core::features::Feature;
|
||||
use codex_core::models_manager::manager::ModelsManager;
|
||||
use codex_core::protocol::AgentMessageDeltaEvent;
|
||||
use codex_core::protocol::AgentMessageEvent;
|
||||
@@ -1961,6 +1962,41 @@ async fn model_selection_popup_snapshot() {
|
||||
assert_snapshot!("model_selection_popup", popup);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn model_picker_hides_show_in_picker_false_models_from_cache() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("test-visible-model")).await;
|
||||
let preset = |slug: &str, show_in_picker: bool| ModelPreset {
|
||||
id: slug.to_string(),
|
||||
model: slug.to_string(),
|
||||
display_name: slug.to_string(),
|
||||
description: format!("{slug} description"),
|
||||
default_reasoning_effort: ReasoningEffortConfig::Medium,
|
||||
supported_reasoning_efforts: vec![ReasoningEffortPreset {
|
||||
effort: ReasoningEffortConfig::Medium,
|
||||
description: "medium".to_string(),
|
||||
}],
|
||||
is_default: false,
|
||||
upgrade: None,
|
||||
show_in_picker,
|
||||
supported_in_api: true,
|
||||
};
|
||||
|
||||
chat.open_model_popup_with_presets(vec![
|
||||
preset("test-visible-model", true),
|
||||
preset("test-hidden-model", false),
|
||||
]);
|
||||
let popup = render_bottom_popup(&chat, 80);
|
||||
assert_snapshot!("model_picker_filters_hidden_models", popup);
|
||||
assert!(
|
||||
popup.contains("test-visible-model"),
|
||||
"expected visible model to appear in picker:\n{popup}"
|
||||
);
|
||||
assert!(
|
||||
!popup.contains("test-hidden-model"),
|
||||
"expected hidden model to be excluded from picker:\n{popup}"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn approvals_selection_popup_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
Reference in New Issue
Block a user