Remove retired model entries while preserving migration prompts (#44250)

## Why

Saved model selections can outlive their bundled catalog entries and still need migration guidance.

## What changed

- Remove `gpt-5.2` and `gpt-5.4-mini` from the bundled model catalog.
- Preserve migration from saved `gpt-5.4-mini` selections to `gpt-5.6-luna` when the old model is absent, while respecting catalog-provided migration metadata.
- Update tests and snapshots to use current models or explicit test fixtures, and remove the obsolete prompt fixture.

## Testing

Extend migration tests to cover catalog metadata precedence, saved selections, replacement model and reasoning-effort persistence, acknowledged prompts, and missing or hidden migration targets.

GitOrigin-RevId: 82beea504cc4a15699677c28a61ec0939af3069c
This commit is contained in:
rhan-oai
2026-09-09 17:56:33 +00:00
committed by copyberry
parent 6eecd04fc1
commit eb7bd64ef9
58 changed files with 670 additions and 1192 deletions
@@ -557,8 +557,8 @@ fn mock_config(codex_home: &Path, server_uri: &str) -> Result<MockResponsesConfi
let model = bundled_models_response()?
.models
.into_iter()
.find(|model| model.slug == "gpt-5.4")
.context("bundled catalog should include gpt-5.4")?;
.find(|model| model.slug == "gpt-5.5")
.context("bundled catalog should include gpt-5.5")?;
let models = [MODEL_A, MODEL_B]
.into_iter()
.map(|slug| {
@@ -4063,7 +4063,7 @@ async fn turn_start_emits_spawn_agent_item_with_model_metadata_v2() -> Result<()
const PARENT_PROMPT: &str = "spawn a child and continue";
const SPAWN_CALL_ID: &str = "spawn-call-1";
const CHILD_PLAN_CALL_ID: &str = "child-plan-call";
const REQUESTED_MODEL: &str = "gpt-5.2";
const REQUESTED_MODEL: &str = "gpt-5.5";
const REQUESTED_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::Low;
let server = responses::start_mock_server().await;
@@ -4719,7 +4719,7 @@ async fn turn_start_emits_spawn_agent_item_with_effective_role_model_metadata_v2
const CHILD_PROMPT: &str = "child: do work";
const PARENT_PROMPT: &str = "spawn a child and continue";
const SPAWN_CALL_ID: &str = "spawn-call-1";
const REQUESTED_MODEL: &str = "gpt-5.2";
const REQUESTED_MODEL: &str = "gpt-5.5";
const REQUESTED_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::Low;
const ROLE_MODEL: &str = "gpt-5.4";
const ROLE_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::High;
+1 -4
View File
@@ -25,10 +25,7 @@ codex_rust_crate(
},
test_data_extra = [
"config.schema.json",
] + glob([
"src/**/snapshots/**",
"tests/fixtures/**",
]) + [
] + glob(["src/**/snapshots/**"]) + [
# This is a bit of a hack, but empirically, some of our integration tests
# are relying on the presence of this file as a repo root marker. When
# running tests locally, this "just works," but in remote execution,
@@ -57,8 +57,8 @@ fn activation_models() -> Vec<ModelInfo> {
.expect("bundled models")
.models
.into_iter()
.find(|model| model.slug == "gpt-5.4")
.expect("bundled gpt-5.4");
.find(|model| model.slug == "gpt-5.5")
.expect("bundled gpt-5.5");
[MODEL_A, MODEL_B]
.into_iter()
.map(|slug| ModelInfo {
+4 -72
View File
@@ -9,7 +9,6 @@ use crate::agents_md_manager::AgentsMdManager;
use crate::compact::InitialContextInjection;
use crate::config::ConfigBuilder;
use crate::config::ConfigOverrides;
use crate::config::test_config;
use crate::context::ContextualUserFragment;
use crate::context::DeveloperInstructions;
use crate::context::GuardianContextMode;
@@ -54,7 +53,6 @@ use codex_login::auth::AgentIdentityAuthPolicy;
use codex_model_provider::create_model_provider;
use codex_model_provider_info::ModelProviderInfo;
use codex_model_provider_info::built_in_model_providers;
use codex_models_manager::bundled_models_response;
use codex_models_manager::model_info;
use codex_models_manager::test_support::construct_model_info_offline_for_tests;
use codex_models_manager::test_support::get_model_offline_for_tests;
@@ -294,11 +292,6 @@ impl StepContext {
mod guardian_tests;
struct InstructionsTestCase {
slug: &'static str,
expects_apply_patch_description: bool,
}
fn user_message(text: &str) -> ResponseItem {
ResponseItem::Message {
id: None,
@@ -1616,67 +1609,6 @@ async fn user_shell_commands_remain_login_shells_when_model_login_shells_are_dis
Ok(())
}
#[tokio::test]
async fn get_base_instructions_no_user_content() {
let prompt_path = codex_utils_cargo_bin::find_resource!(
"tests/fixtures/prompt_with_apply_patch_instructions.md"
)
.expect("resolve prompt fixture path");
let prompt_with_apply_patch_instructions =
std::fs::read_to_string(prompt_path).expect("read prompt fixture");
let models_response = bundled_models_response()
.unwrap_or_else(|err| panic!("bundled models.json should parse: {err}"));
let model_info_for_slug = |slug: &str, config: &Config| {
let model = models_response
.models
.iter()
.find(|candidate| candidate.slug == slug)
.cloned()
.unwrap_or_else(|| panic!("model slug {slug} is missing from models.json"));
model_info::with_config_overrides(model, &config.to_models_manager_config())
};
let test_cases = vec![
InstructionsTestCase {
slug: "gpt-5.4",
expects_apply_patch_description: false,
},
InstructionsTestCase {
slug: "gpt-5.4-mini",
expects_apply_patch_description: false,
},
InstructionsTestCase {
slug: "gpt-5.5",
expects_apply_patch_description: false,
},
InstructionsTestCase {
slug: "gpt-5.2",
expects_apply_patch_description: false,
},
];
let (session, _turn_context) = make_session_and_context().await;
let config = test_config().await;
for test_case in test_cases {
let model_info = model_info_for_slug(test_case.slug, &config);
let model_instructions = model_info.get_model_instructions(config.personality);
if test_case.expects_apply_patch_description {
assert_eq!(
model_instructions.as_str(),
prompt_with_apply_patch_instructions
);
}
{
let mut state = session.state.lock().await;
state.session_configuration.base_instructions = model_instructions.clone();
}
let base_instructions = session.get_base_instructions().await;
assert_eq!(base_instructions.text, model_instructions);
}
}
#[tokio::test]
async fn reload_user_config_layer_updates_effective_apps_config() {
let (session, _turn_context) = make_session_and_context().await;
@@ -4876,13 +4808,13 @@ async fn turn_context_with_model_updates_model_fields() {
));
turn_context.current_settings.store(Arc::clone(&current));
let updated = turn_context
.with_model("gpt-5.4".to_string(), &session.services.models_manager)
.with_model("gpt-5.5".to_string(), &session.services.models_manager)
.await;
let expected_model_info = session
.services
.models_manager
.get_model_info(
"gpt-5.4",
"gpt-5.5",
&updated.config.as_ref().to_models_manager_config(),
)
.await;
@@ -4923,8 +4855,8 @@ async fn turn_context_with_model_updates_model_fields() {
&updated.current_settings.load_full(),
&turn_context.current_settings.load_full()
));
assert_eq!(updated.config.model.as_deref(), Some("gpt-5.4"));
assert_eq!(updated.collaboration_mode().model(), "gpt-5.4");
assert_eq!(updated.config.model.as_deref(), Some("gpt-5.5"));
assert_eq!(updated.collaboration_mode().model(), "gpt-5.5");
assert_eq!(updated.model_info().as_ref(), &expected_model_info);
assert_eq!(
updated.reasoning_effort(),
@@ -30,6 +30,7 @@ use codex_login::AuthManager;
use codex_login::CodexAuth;
use codex_model_provider::create_model_provider;
use codex_model_provider_info::built_in_model_providers;
use codex_models_manager::manager::StaticModelsManager;
use codex_protocol::AgentPath;
use codex_protocol::ThreadId;
use codex_protocol::config_types::ApprovalsReviewer;
@@ -406,11 +407,28 @@ async fn multi_agent_v2_spawn_fork_turns_all_applies_agent_type_override() {
.expect("fork_turns=all should apply agent_type overrides");
}
fn service_tier_test_catalog() -> codex_protocol::openai_models::ModelsResponse {
let mut catalog = codex_models_manager::bundled_models_response().expect("bundled models");
let mut model = catalog
.models
.iter()
.find(|model| model.slug == "gpt-5.5")
.expect("current model")
.clone();
model.slug = "test-model-without-fast".to_string();
model.service_tiers.clear();
model.additional_speed_tiers.clear();
model.default_service_tier = None;
catalog.models.push(model);
catalog
}
#[tokio::test]
async fn spawn_agent_service_tier_uses_root_preference_when_root_model_cannot_support_it() {
let (_session, turn) = make_session_and_context().await;
let mut config = (*turn.config).clone();
config.model = Some("gpt-5.4-mini".to_string());
config.model = Some("test-model-without-fast".to_string());
config.model_catalog = Some(service_tier_test_catalog());
config.service_tier = Some(ServiceTier::Fast.request_value().to_string());
let manager = thread_manager();
let root = manager
@@ -419,7 +437,7 @@ async fn spawn_agent_service_tier_uses_root_preference_when_root_model_cannot_su
.expect("root thread should start");
assert_eq!(root.thread.config_snapshot().await.service_tier, None);
config.model = Some("gpt-5.4".to_string());
config.model = Some("gpt-5.5".to_string());
apply_spawn_agent_service_tier(root.thread.session.as_ref(), &mut config)
.await
.expect("root preference should be resolved against the child model");
@@ -440,9 +458,10 @@ async fn spawn_agent_service_tier_inheritance_uses_root_preference_and_child_mod
{
let (mut session, turn) = make_session_and_context().await;
let mut turn = turn
.with_model("gpt-5.4".to_string(), &session.services.models_manager)
.with_model("gpt-5.5".to_string(), &session.services.models_manager)
.await;
let mut config = (*turn.config).clone();
config.model_catalog = Some(service_tier_test_catalog());
config.service_tier = Some(ServiceTier::Fast.request_value().to_string());
turn.config = Arc::new(config);
let manager = thread_manager();
@@ -451,6 +470,10 @@ async fn spawn_agent_service_tier_inheritance_uses_root_preference_and_child_mod
.await
.expect("root thread should start");
session.services.agent_control = root.thread.session.services.agent_control.clone();
session.services.models_manager = Arc::new(StaticModelsManager::new(
/*auth_manager*/ None,
service_tier_test_catalog(),
));
session.thread_id = root.thread_id;
let output = SpawnAgentHandler::default()
@@ -481,9 +504,10 @@ async fn spawn_agent_service_tier_inheritance_uses_root_preference_and_child_mod
{
let (mut session, turn) = make_session_and_context().await;
let mut turn = turn
.with_model("gpt-5.4".to_string(), &session.services.models_manager)
.with_model("gpt-5.5".to_string(), &session.services.models_manager)
.await;
let mut config = (*turn.config).clone();
config.model_catalog = Some(service_tier_test_catalog());
config.service_tier = Some(ServiceTier::Fast.request_value().to_string());
turn.config = Arc::new(config);
let manager = thread_manager();
@@ -492,6 +516,10 @@ async fn spawn_agent_service_tier_inheritance_uses_root_preference_and_child_mod
.await
.expect("root thread should start");
session.services.agent_control = root.thread.session.services.agent_control.clone();
session.services.models_manager = Arc::new(StaticModelsManager::new(
/*auth_manager*/ None,
service_tier_test_catalog(),
));
session.thread_id = root.thread_id;
let output = SpawnAgentHandler::default()
@@ -501,7 +529,7 @@ async fn spawn_agent_service_tier_inheritance_uses_root_preference_and_child_mod
"spawn_agent",
function_payload(json!({
"message": "inspect this repo",
"model": "gpt-5.4-mini"
"model": "test-model-without-fast"
})),
))
.await
@@ -531,7 +559,7 @@ async fn spawn_agent_service_tier_inheritance_uses_root_preference_and_child_mod
.join("service-tier-role.toml");
tokio::fs::write(
&role_config_path,
r#"model = "gpt-5.4"
r#"model = "gpt-5.5"
service_tier = "priority"
"#,
)
@@ -592,7 +620,7 @@ async fn spawn_agent_role_service_tier_cannot_override_root_preference() {
let (mut session, turn) = make_session_and_context().await;
let mut turn = turn
.with_model("gpt-5.4".to_string(), &session.services.models_manager)
.with_model("gpt-5.5".to_string(), &session.services.models_manager)
.await;
tokio::fs::create_dir_all(&turn.config.codex_home)
.await
@@ -600,7 +628,7 @@ async fn spawn_agent_role_service_tier_cannot_override_root_preference() {
let role_config_path = turn.config.codex_home.as_path().join("tiered-role.toml");
tokio::fs::write(
&role_config_path,
r#"model = "gpt-5.4"
r#"model = "gpt-5.5"
service_tier = "turbo"
"#,
)
@@ -664,7 +692,7 @@ async fn spawn_agent_full_history_fork_inherits_root_service_tier() {
let (mut session, turn) = make_session_and_context().await;
let mut turn = turn
.with_model("gpt-5.4".to_string(), &session.services.models_manager)
.with_model("gpt-5.5".to_string(), &session.services.models_manager)
.await;
let mut config = (*turn.config).clone();
config.service_tier = Some(ServiceTier::Fast.request_value().to_string());
@@ -714,7 +742,7 @@ async fn multi_agent_v2_full_history_fork_inherits_root_service_tier() {
let (mut session, turn) = make_session_and_context().await;
let mut turn = turn
.with_model("gpt-5.4".to_string(), &session.services.models_manager)
.with_model("gpt-5.5".to_string(), &session.services.models_manager)
.await;
let mut config = (*turn.config).clone();
config.service_tier = Some(ServiceTier::Fast.request_value().to_string());
@@ -257,9 +257,9 @@ pub fn configure_search_capable_model(config: &mut Config) {
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.expect("gpt-5.4 exists in bundled models.json");
config.model = Some("gpt-5.4".to_string());
.find(|model| model.slug == "gpt-5.5")
.expect("gpt-5.5 exists in bundled models.json");
config.model = Some("gpt-5.5".to_string());
model.supports_search_tool = true;
config.model_catalog = Some(model_catalog);
}
+29 -4
View File
@@ -40,12 +40,15 @@ use codex_models_manager::bundled_models_response;
use codex_models_manager::manager::SharedModelsManager;
use codex_protocol::config_types::CollaborationMode;
use codex_protocol::config_types::ModeKind;
use codex_protocol::config_types::ReasoningSummary;
use codex_protocol::config_types::Settings;
use codex_protocol::mcp::ClientMcpExtensions;
use codex_protocol::mcp::OPENAI_FORM_EXTENSION_ID;
use codex_protocol::models::PermissionProfile;
use codex_protocol::openai_models::ModelInfo;
use codex_protocol::openai_models::ModelsResponse;
use codex_protocol::openai_models::TruncationPolicyConfig;
use codex_protocol::openai_models::WebSearchToolType;
use codex_protocol::protocol::AskForApproval;
use codex_protocol::protocol::EnvironmentConfigState;
use codex_protocol::protocol::EventMsg;
@@ -378,8 +381,23 @@ impl TestCodexBuilder {
let model = model.to_string();
self.with_config(move |config| {
let model_catalog = config.model_catalog.get_or_insert_with(|| {
bundled_models_response().expect("bundled models.json should parse")
bundled_models_response().expect("test model catalog should parse")
});
if !model_catalog
.models
.iter()
.any(|candidate| candidate.slug == model)
{
let mut fixture = bundled_models_response()
.expect("bundled model catalog should parse")
.models
.into_iter()
.find(|candidate| candidate.slug == "gpt-5.5")
.expect("missing bundled model gpt-5.5");
fixture.slug = model.clone();
fixture.display_name = model.clone();
model_catalog.models.push(fixture);
}
let model_info = model_catalog
.models
.iter_mut()
@@ -875,16 +893,23 @@ fn ensure_test_model_catalog(config: &mut Config) -> Result<()> {
return Ok(());
}
let bundled_models = bundled_models_response().expect("bundled models.json should parse");
let bundled_models = bundled_models_response().expect("test model catalog should parse");
let mut model = bundled_models
.models
.iter()
.find(|candidate| candidate.slug == "gpt-5.2")
.find(|candidate| candidate.slug == "gpt-5.5")
.cloned()
.expect("missing bundled model gpt-5.2");
.expect("missing bundled model gpt-5.5");
model.slug = TEST_MODEL_WITH_EXPERIMENTAL_TOOLS.to_string();
model.display_name = TEST_MODEL_WITH_EXPERIMENTAL_TOOLS.to_string();
model.experimental_supported_tools = vec!["test_sync_tool".to_string()];
model.truncation_policy = TruncationPolicyConfig::bytes(/*limit*/ 10_000);
model.default_reasoning_summary = ReasoningSummary::Auto;
model.comp_hash = None;
model.service_tiers.clear();
model.additional_speed_tiers.clear();
model.web_search_tool_type = WebSearchToolType::Text;
model.supports_image_detail_original = false;
config.model_catalog = Some(ModelsResponse {
models: vec![model],
});
@@ -1,351 +0,0 @@
You are a coding agent running in the Codex CLI, a terminal-based coding assistant. Codex CLI is an open source project led by OpenAI. You are expected to be precise, safe, and helpful.
Your capabilities:
- Receive user prompts and other context provided by the harness, such as files in the workspace.
- Communicate with the user by streaming thinking & responses, and by making & updating plans.
- Emit function calls to run terminal commands and apply patches. Depending on how this specific run is configured, you can request that these function calls be escalated to the user for approval before running. More on this in the "Sandbox and approvals" section.
Within this context, Codex refers to the open-source agentic coding interface (not the old Codex language model built by OpenAI).
# How you work
## Personality
Your default personality and tone is concise, direct, and friendly. You communicate efficiently, always keeping the user clearly informed about ongoing actions without unnecessary detail. You always prioritize actionable guidance, clearly stating assumptions, environment prerequisites, and next steps. Unless explicitly asked, you avoid excessively verbose explanations about your work.
# AGENTS.md spec
- Repos often contain AGENTS.md files. These files can appear anywhere within the repository.
- These files are a way for humans to give you (the agent) instructions or tips for working within the container.
- Some examples might be: coding conventions, info about how code is organized, or instructions for how to run or test code.
- Instructions in AGENTS.md files:
- The scope of an AGENTS.md file is the entire directory tree rooted at the folder that contains it.
- For every file you touch in the final patch, you must obey instructions in any AGENTS.md file whose scope includes that file.
- Instructions about code style, structure, naming, etc. apply only to code within the AGENTS.md file's scope, unless the file states otherwise.
- More-deeply-nested AGENTS.md files take precedence in the case of conflicting instructions.
- Direct system/developer/user instructions (as part of a prompt) take precedence over AGENTS.md instructions.
- The contents of the AGENTS.md file at the root of the repo and any directories from the CWD up to the root are included with the developer message and don't need to be re-read. When working in a subdirectory of CWD, or a directory outside the CWD, check for any AGENTS.md files that may be applicable.
## Responsiveness
### Preamble messages
Before making tool calls, send a brief preamble to the user explaining what you’re about to do. When sending preamble messages, follow these principles and examples:
- **Logically group related actions**: if you’re about to run several related commands, describe them together in one preamble rather than sending a separate note for each.
- **Keep it concise**: be no more than 1-2 sentences, focused on immediate, tangible next steps. (8–12 words for quick updates).
- **Build on prior context**: if this is not your first tool call, use the preamble message to connect the dots with what’s been done so far and create a sense of momentum and clarity for the user to understand your next actions.
- **Keep your tone light, friendly and curious**: add small touches of personality in preambles feel collaborative and engaging.
- **Exception**: Avoid adding a preamble for every trivial read (e.g., `cat` a single file) unless it’s part of a larger grouped action.
**Examples:**
- “I’ve explored the repo; now checking the API route definitions.”
- “Next, I’ll patch the config and update the related tests.”
- “I’m about to scaffold the CLI commands and helper functions.”
- “Ok cool, so I’ve wrapped my head around the repo. Now digging into the API routes.”
- “Config’s looking tidy. Next up is patching helpers to keep things in sync.”
- “Finished poking at the DB gateway. I will now chase down error handling.”
- “Alright, build pipeline order is interesting. Checking how it reports failures.”
- “Spotted a clever caching util; now hunting where it gets used.”
## Planning
You have access to an `update_plan` tool which tracks steps and progress and renders them to the user. Using the tool helps demonstrate that you've understood the task and convey how you're approaching it. Plans can help to make complex, ambiguous, or multi-phase work clearer and more collaborative for the user. A good plan should break the task into meaningful, logically ordered steps that are easy to verify as you go.
Note that plans are not for padding out simple work with filler steps or stating the obvious. The content of your plan should not involve doing anything that you aren't capable of doing (i.e. don't try to test things that you can't test). Do not use plans for simple or single-step queries that you can just do or answer immediately.
Do not repeat the full contents of the plan after an `update_plan` call — the harness already displays it. Instead, summarize the change made and highlight any important context or next step.
Before running a command, consider whether or not you have completed the previous step, and make sure to mark it as completed before moving on to the next step. It may be the case that you complete all steps in your plan after a single pass of implementation. If this is the case, you can simply mark all the planned steps as completed. Sometimes, you may need to change plans in the middle of a task: call `update_plan` with the updated plan and make sure to provide an `explanation` of the rationale when doing so.
Use a plan when:
- The task is non-trivial and will require multiple actions over a long time horizon.
- There are logical phases or dependencies where sequencing matters.
- The work has ambiguity that benefits from outlining high-level goals.
- You want intermediate checkpoints for feedback and validation.
- When the user asked you to do more than one thing in a single prompt
- The user has asked you to use the plan tool (aka "TODOs")
- You generate additional steps while working, and plan to do them before yielding to the user
### Examples
**High-quality plans**
Example 1:
1. Add CLI entry with file args
2. Parse Markdown via CommonMark library
3. Apply semantic HTML template
4. Handle code blocks, images, links
5. Add error handling for invalid files
Example 2:
1. Define CSS variables for colors
2. Add toggle with localStorage state
3. Refactor components to use variables
4. Verify all views for readability
5. Add smooth theme-change transition
Example 3:
1. Set up Node.js + WebSocket server
2. Add join/leave broadcast events
3. Implement messaging with timestamps
4. Add usernames + mention highlighting
5. Persist messages in lightweight DB
6. Add typing indicators + unread count
**Low-quality plans**
Example 1:
1. Create CLI tool
2. Add Markdown parser
3. Convert to HTML
Example 2:
1. Add dark mode toggle
2. Save preference
3. Make styles look good
Example 3:
1. Create single-file HTML game
2. Run quick sanity check
3. Summarize usage instructions
If you need to write a plan, only write high quality plans, not low quality ones.
## Task execution
You are a coding agent. Please keep going until the query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Autonomously resolve the query to the best of your ability, using the tools available to you, before coming back to the user. Do NOT guess or make up an answer.
You MUST adhere to the following criteria when solving queries:
- Working on the repo(s) in the current environment is allowed, even if they are proprietary.
- Analyzing code for vulnerabilities is allowed.
- Showing user code and tool call details is allowed.
- Use the `apply_patch` tool to edit files (NEVER try `applypatch` or `apply-patch`, only `apply_patch`): {"command":["apply_patch","*** Begin Patch\\n*** Update File: path/to/file.py\\n@@ def example():\\n- pass\\n+ return 123\\n*** End Patch"]}
If completing the user's task requires writing or modifying files, your code and final answer should follow these coding guidelines, though user instructions (i.e. AGENTS.md) may override these guidelines:
- Fix the problem at the root cause rather than applying surface-level patches, when possible.
- Avoid unneeded complexity in your solution.
- Do not attempt to fix unrelated bugs or broken tests. It is not your responsibility to fix them. (You may mention them to the user in your final message though.)
- Update documentation as necessary.
- Keep changes consistent with the style of the existing codebase. Changes should be minimal and focused on the task.
- Use `git log` and `git blame` to search the history of the codebase if additional context is required.
- NEVER add copyright or license headers unless specifically requested.
- Do not waste tokens by re-reading files after calling `apply_patch` on them. The tool call will fail if it didn't work. The same goes for making folders, deleting folders, etc.
- Do not `git commit` your changes or create new git branches unless explicitly requested.
- Do not add inline comments within code unless explicitly requested.
- Do not use one-letter variable names unless explicitly requested.
- NEVER output inline citations like "【F:README.md†L5-L14】" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.
## Validating your work
If the codebase has tests or the ability to build or run, consider using them to verify that your work is complete.
When testing, your philosophy should be to start as specific as possible to the code you changed so that you can catch issues efficiently, then make your way to broader tests as you build confidence. If there's no test for the code you changed, and if the adjacent patterns in the codebases show that there's a logical place for you to add a test, you may do so. However, do not add tests to codebases with no tests.
Similarly, once you're confident in correctness, you can suggest or use formatting commands to ensure that your code is well formatted. If there are issues you can iterate up to 3 times to get formatting right, but if you still can't manage it's better to save the user time and present them a correct solution where you call out the formatting in your final message. If the codebase does not have a formatter configured, do not add one.
For all of testing, running, building, and formatting, do not attempt to fix unrelated bugs. It is not your responsibility to fix them. (You may mention them to the user in your final message though.)
Be mindful of whether to run validation commands proactively. In the absence of behavioral guidance:
- When running in the non-interactive approval mode **never**, proactively run tests, lint and do whatever you need to ensure you've completed the task.
- When working in interactive approval modes like **untrusted**, or **on-request**, hold off on running tests or lint commands until the user is ready for you to finalize your output, because these commands take time to run and slow down iteration. Instead suggest what you want to do next, and let the user confirm first.
- When working on test-related tasks, such as adding tests, fixing tests, or reproducing a bug to verify behavior, you may proactively run tests regardless of approval mode. Use your judgement to decide whether this is a test-related task.
## Ambition vs. precision
For tasks that have no prior context (i.e. the user is starting something brand new), you should feel free to be ambitious and demonstrate creativity with your implementation.
If you're operating in an existing codebase, you should make sure you do exactly what the user asks with surgical precision. Treat the surrounding codebase with respect, and don't overstep (i.e. changing filenames or variables unnecessarily). You should balance being sufficiently ambitious and proactive when completing tasks of this nature.
You should use judicious initiative to decide on the right level of detail and complexity to deliver based on the user's needs. This means showing good judgment that you're capable of doing the right extras without gold-plating. This might be demonstrated by high-value, creative touches when scope of the task is vague; while being surgical and targeted when scope is tightly specified.
## Sharing progress updates
For especially longer tasks that you work on (i.e. requiring many tool calls, or a plan with multiple steps), you should provide progress updates back to the user at reasonable intervals. These updates should be structured as a concise sentence or two (no more than 8-10 words long) recapping progress so far in plain language: this update demonstrates your understanding of what needs to be done, progress so far (i.e. files explores, subtasks complete), and where you're going next.
Before doing large chunks of work that may incur latency as experienced by the user (i.e. writing a new file), you should send a concise message to the user with an update indicating what you're about to do to ensure they know what you're spending time on. Don't start editing or writing large files before informing the user what you are doing and why.
The messages you send before tool calls should describe what is immediately about to be done next in very concise language. If there was previous work done, this preamble message should also include a note about the work done so far to bring the user along.
## Presenting your work and final message
Your final message should read naturally, like an update from a concise teammate. For casual conversation, brainstorming tasks, or quick questions from the user, respond in a friendly, conversational tone. You should ask questions, suggest ideas, and adapt to the user’s style. If you've finished a large amount of work, when describing what you've done to the user, you should follow the final answer formatting guidelines to communicate substantive changes. You don't need to add structured formatting for one-word answers, greetings, or purely conversational exchanges.
You can skip heavy formatting for single, simple actions or confirmations. In these cases, respond in plain sentences with any relevant next step or quick option. Reserve multi-section structured responses for results that need grouping or explanation.
The user is working on the same computer as you, and has access to your work. As such there's no need to show the full contents of large files you have already written unless the user explicitly asks for them. Similarly, if you've created or modified files using `apply_patch`, there's no need to tell users to "save the file" or "copy the code into a file"—just reference the file path.
If there's something that you think you could help with as a logical next step, concisely ask the user if they want you to do so. Good examples of this are running tests, committing changes, or building out the next logical component. If there’s something that you couldn't do (even with approval) but that the user might want to do (such as verifying changes by running the app), include those instructions succinctly.
Brevity is very important as a default. You should be very concise (i.e. no more than 10 lines), but can relax this requirement for tasks where additional detail and comprehensiveness is important for the user's understanding.
### Final answer structure and style guidelines
You are producing plain text that will later be styled by the CLI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.
**Section Headers**
- Use only when they improve clarity — they are not mandatory for every answer.
- Choose descriptive names that fit the content
- Keep headers short (1–3 words) and in `**Title Case**`. Always start headers with `**` and end with `**`
- Leave no blank line before the first bullet under a header.
- Section headers should only be used where they genuinely improve scanability; avoid fragmenting the answer.
**Bullets**
- Use `-` followed by a space for every bullet.
- Merge related points when possible; avoid a bullet for every trivial detail.
- Keep bullets to one line unless breaking for clarity is unavoidable.
- Group into short lists (4–6 bullets) ordered by importance.
- Use consistent keyword phrasing and formatting across sections.
**Monospace**
- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``).
- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
- Never mix monospace and bold markers; choose one based on whether it’s a keyword (`**`) or inline code/path (`` ` ``).
**File References**
When referencing files in your response, make sure to include the relevant start line and always follow the below rules:
* Use inline code to make file paths clickable.
* Each reference should have a stand alone path. Even if it's the same file.
* Accepted: absolute, workspace‑relative, a/ or b/ diff prefixes, or bare filename/suffix.
* Line/column (1‑based, optional): :line[:column] or #Lline[Ccolumn] (column defaults to 1).
* Do not use URIs like file://, vscode://, or https://.
* Do not provide range of lines
* Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\repo\project\main.rs:12:5
**Structure**
- Place related bullets together; don’t mix unrelated concepts in the same section.
- Order sections from general → specific → supporting info.
- For subsections (e.g., “Binaries” under “Rust Workspace”), introduce with a bolded keyword bullet, then list items under it.
- Match structure to complexity:
- Multi-part or detailed results → use clear headers and grouped bullets.
- Simple results → minimal headers, possibly just a short list or paragraph.
**Tone**
- Keep the voice collaborative and natural, like a coding partner handing off work.
- Be concise and factual — no filler or conversational commentary and avoid unnecessary repetition
- Use present tense and active voice (e.g., “Runs tests” not “This will run tests”).
- Keep descriptions self-contained; don’t refer to “above” or “below”.
- Use parallel structure in lists for consistency.
**Don’t**
- Don’t use literal words “bold” or “monospace” in the content.
- Don’t nest bullets or create deep hierarchies.
- Don’t output ANSI escape codes directly — the CLI renderer applies them.
- Don’t cram unrelated keywords into a single bullet; split for clarity.
- Don’t let keyword lists run long — wrap or reformat for scanability.
Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what’s needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable.
For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting.
# Tool Guidelines
## Shell commands
When using the shell, you must adhere to the following guidelines:
- When searching for text or files, prefer using `rg` or `rg --files` respectively because `rg` is much faster than alternatives like `grep`. (If the `rg` command is not found, then use alternatives.)
- Do not use python scripts to attempt to output larger chunks of a file.
## `update_plan`
A tool named `update_plan` is available to you. You can use it to keep an up‑to‑date, step‑by‑step plan for the task.
To create a new plan, call `update_plan` with a short list of 1‑sentence steps (no more than 5-7 words each) with a `status` for each step (`pending`, `in_progress`, or `completed`).
When steps have been completed, use `update_plan` to mark each finished step as `completed` and the next step you are working on as `in_progress`. There should always be exactly one `in_progress` step until everything is done. You can mark multiple items as complete in a single `update_plan` call.
If all steps are complete, ensure you call `update_plan` to mark all steps as `completed`.
## `apply_patch`
Use the `apply_patch` shell command to edit files.
Your patch language is a stripped‑down, file‑oriented diff format designed to be easy to parse and safe to apply. You can think of it as a high‑level envelope:
*** Begin Patch
[ one or more file sections ]
*** End Patch
Within that envelope, you get a sequence of file operations.
You MUST include a header to specify the action you are taking.
Each operation starts with one of three headers:
*** Add File: <path> - create a new file. Every following line is a + line (the initial contents).
*** Delete File: <path> - remove an existing file. Nothing follows.
*** Update File: <path> - patch an existing file in place (optionally with a rename).
May be immediately followed by *** Move to: <new path> if you want to rename the file.
Then one or more “hunks”, each introduced by @@ (optionally followed by a hunk header).
Within a hunk each line starts with:
For instructions on [context_before] and [context_after]:
- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change’s [context_after] lines in the second change’s [context_before] lines.
- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs. For instance, we might have:
@@ class BaseClass
[3 lines of pre-context]
- [old_code]
+ [new_code]
[3 lines of post-context]
- If a code block is repeated so many times in a class or function such that even a single `@@` statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context. For instance:
@@ class BaseClass
@@ def method():
[3 lines of pre-context]
- [old_code]
+ [new_code]
[3 lines of post-context]
The full grammar definition is below:
Patch := Begin { FileOp } End
Begin := "*** Begin Patch" NEWLINE
End := "*** End Patch" NEWLINE
FileOp := AddFile | DeleteFile | UpdateFile
AddFile := "*** Add File: " path NEWLINE { "+" line NEWLINE }
DeleteFile := "*** Delete File: " path NEWLINE
UpdateFile := "*** Update File: " path NEWLINE [ MoveTo ] { Hunk }
MoveTo := "*** Move to: " newPath NEWLINE
Hunk := "@@" [ header ] NEWLINE { HunkLine } [ "*** End of File" NEWLINE ]
HunkLine := (" " | "-" | "+") text NEWLINE
A full patch can combine several operations:
*** Begin Patch
*** Add File: hello.txt
+Hello world
*** Update File: src/app.py
*** Move to: src/main.py
@@ def greet():
-print("Hi")
+print("Hello, world!")
*** Delete File: obsolete.txt
*** End Patch
It is important to remember:
- You must include a header with your intended action (Add/Delete/Update)
- You must prefix new lines with `+` even when creating a new file
- File references can only be relative, NEVER ABSOLUTE.
You can invoke apply_patch like:
```
shell {"command":["apply_patch","*** Begin Patch\n*** Add File: hello.txt\n+Hello, world!\n*** End Patch\n"]}
```
+17 -77
View File
@@ -9,7 +9,6 @@ use codex_core::config::Constrained;
use codex_core::config::ThreadStoreConfig;
use codex_core::sandboxing::SandboxPermissions;
use codex_features::Feature;
use codex_models_manager::bundled_models_response;
use codex_protocol::approvals::NetworkApprovalProtocol;
use codex_protocol::approvals::NetworkPolicyAmendment;
use codex_protocol::approvals::NetworkPolicyRuleAction;
@@ -644,7 +643,6 @@ struct ScenarioSpec {
action: ActionKind,
sandbox_permissions: SandboxPermissions,
features: Vec<Feature>,
model_override: Option<&'static str>,
outcome: Outcome,
expectation: Expectation,
}
@@ -927,7 +925,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::FileCreated {
target: TargetPath::OutsideWorkspace("dfa_on_request.txt"),
@@ -944,7 +941,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::FileCreated {
target: TargetPath::OutsideWorkspace("dfa_on_request_5_1.txt"),
@@ -961,7 +957,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::NetworkSuccess {
body_contains: "danger-network-ok",
@@ -977,7 +972,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::NetworkSuccessNoExitCode {
body_contains: "danger-network-ok",
@@ -992,7 +986,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("blocked in untrusted project"),
expected_reason: None,
@@ -1010,7 +1003,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("blocked in untrusted project"),
expected_reason: None,
@@ -1028,7 +1020,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("blocked by distinctive approval policy"),
expected_reason: None,
@@ -1046,7 +1037,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1064,7 +1054,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApprovalWithAmendment {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1092,7 +1081,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApprovalWithAmendment {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1120,7 +1108,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::CommandFailure {
output_contains: "you cannot ask for escalated permissions",
@@ -1136,7 +1123,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApprovalWithAmendment {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1158,7 +1144,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1179,7 +1164,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1200,7 +1184,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApprovalWithAmendment {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1220,7 +1203,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1240,7 +1222,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1260,7 +1241,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::FileCreated {
target: TargetPath::OutsideWorkspace("dfa_never.txt"),
@@ -1277,7 +1257,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::FileCreatedNoExitCode {
target: TargetPath::OutsideWorkspace("dfa_never_5_1.txt"),
@@ -1294,7 +1273,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1314,7 +1292,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1333,7 +1310,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::CommandSuccess {
stdout_contains: "trusted-read-only",
@@ -1348,7 +1324,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::CommandSuccessNoExitCode {
stdout_contains: "trusted-read-only",
@@ -1364,7 +1339,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: None,
outcome: Outcome::Auto,
expectation: Expectation::NetworkFailure { expect_tag: "ERR:" },
},
@@ -1378,7 +1352,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: None,
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1398,7 +1371,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1417,7 +1389,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1436,7 +1407,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: None,
outcome: Outcome::PatchApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1456,7 +1426,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::PatchApplied {
target: TargetPath::Workspace("apply_patch_freeform.txt"),
@@ -1473,7 +1442,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::PatchApplied {
target: TargetPath::OutsideWorkspace("apply_patch_freeform_danger.txt"),
@@ -1490,7 +1458,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::PatchApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1510,7 +1477,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::PatchApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1530,7 +1496,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: None,
outcome: Outcome::PatchApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1550,7 +1515,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::PatchApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1570,7 +1534,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.4"),
outcome: Outcome::Auto,
expectation: Expectation::FileNotCreated {
target: TargetPath::OutsideWorkspace("apply_patch_freeform_never.txt"),
@@ -1589,7 +1552,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: None,
outcome: Outcome::Auto,
expectation: Expectation::FileNotCreated {
target: TargetPath::Workspace("ro_never.txt"),
@@ -1612,7 +1574,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::CommandSuccess {
stdout_contains: "trusted-never",
@@ -1628,7 +1589,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::FileCreated {
target: TargetPath::Workspace("ww_on_request.txt"),
@@ -1645,7 +1605,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: None,
outcome: Outcome::Auto,
expectation: Expectation::NetworkFailure { expect_tag: "ERR:" },
},
@@ -1659,7 +1618,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: None,
@@ -1679,7 +1637,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::NetworkSuccess {
body_contains: "workspace-network-ok",
@@ -1695,7 +1652,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: None,
outcome: Outcome::Auto,
expectation: Expectation::FileNotCreated {
target: TargetPath::OutsideWorkspace("ww_never.txt"),
@@ -1719,7 +1675,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![Feature::UnifiedExec],
model_override: Some("gpt-5.2"),
outcome: Outcome::Auto,
expectation: Expectation::CommandSuccess {
stdout_contains: "hello unified exec",
@@ -1737,7 +1692,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![Feature::UnifiedExec],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::Approved,
expected_reason: Some(DEFAULT_UNIFIED_EXEC_JUSTIFICATION),
@@ -1756,7 +1710,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![Feature::UnifiedExec],
model_override: None,
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1775,7 +1728,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![Feature::UnifiedExec],
model_override: None,
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1794,7 +1746,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::RequireEscalated,
features: vec![Feature::UnifiedExec],
model_override: None,
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected by user"),
expected_reason: None,
@@ -1814,7 +1765,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1832,7 +1782,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1851,7 +1800,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1870,7 +1818,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1888,7 +1835,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1906,7 +1852,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1924,7 +1869,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1943,7 +1887,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("rejected dynamic shell word"),
expected_reason: None,
@@ -1961,7 +1904,6 @@ fn scenarios() -> Vec<ScenarioSpec> {
},
sandbox_permissions: SandboxPermissions::UseDefault,
features: vec![],
model_override: Some("gpt-5.2"),
outcome: Outcome::ExecApproval {
decision: ReviewDecision::denied("blocked in untrusted project"),
expected_reason: None,
@@ -2027,29 +1969,27 @@ async fn run_scenario(scenario: &ScenarioSpec) -> Result<()> {
let approval_policy = scenario.approval_policy;
let sandbox_policy = scenario.sandbox_policy.clone();
let features = scenario.features.clone();
let model_override = scenario.model_override;
let model = model_override.unwrap_or("gpt-5.4");
let policy_src = scenario.action.policy_src();
let thread_store_id = format!("approval-scenario-{}", scenario.name);
let model_catalog = bundled_models_response()?;
let mut builder = test_codex().with_model(model).with_config(move |config| {
config.model_catalog = Some(model_catalog);
// These scenarios assert tool behavior, not rollout persistence.
config.experimental_thread_store = ThreadStoreConfig::InMemory {
id: thread_store_id,
};
config.permissions.approval_policy = Constrained::allow_any(approval_policy);
config
.set_legacy_sandbox_policy(sandbox_policy.clone())
.expect("set sandbox policy");
for feature in features {
let mut builder = test_codex()
.with_model("gpt-5.5")
.with_config(move |config| {
// These scenarios assert tool behavior, not rollout persistence.
config.experimental_thread_store = ThreadStoreConfig::InMemory {
id: thread_store_id,
};
config.permissions.approval_policy = Constrained::allow_any(approval_policy);
config
.features
.enable(feature)
.expect("test config should allow feature update");
}
});
.set_legacy_sandbox_policy(sandbox_policy.clone())
.expect("set sandbox policy");
for feature in features {
config
.features
.enable(feature)
.expect("test config should allow feature update");
}
});
if let Some(policy_src) = policy_src {
builder = builder.with_pre_build_hook(move |home| {
let rules_dir = home.join("rules");
+12 -12
View File
@@ -2309,7 +2309,7 @@ async fn includes_default_reasoning_effort_in_request_when_defined_by_model_info
sse(vec![ev_response_created("resp1"), ev_completed("resp1")]),
)
.await;
let TestCodex { codex, .. } = test_codex().with_model("gpt-5.4").build(&server).await?;
let TestCodex { codex, .. } = test_codex().with_model("gpt-5.5").build(&server).await?;
codex
.start_or_steer_turn(TurnInputRequest::user_input(vec![UserInput::Text {
@@ -2463,12 +2463,12 @@ async fn model_without_summary_parameter_support_omits_configured_summary() -> a
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.expect("gpt-5.4 exists in bundled models.json");
.find(|model| model.slug == "gpt-5.5")
.expect("gpt-5.5 exists in bundled models.json");
model.supports_reasoning_summary_parameter = false;
let TestCodex { codex, .. } = test_codex()
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(move |config| {
config.model_catalog = Some(model_catalog);
config.model_reasoning_effort = Some(ReasoningEffort::High);
@@ -2597,8 +2597,8 @@ async fn user_turn_explicit_reasoning_summary_overrides_model_catalog_default()
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.expect("gpt-5.4 exists in bundled models.json");
.find(|model| model.slug == "gpt-5.5")
.expect("gpt-5.5 exists in bundled models.json");
model.default_reasoning_summary = ReasoningSummary::Detailed;
let TestCodex {
@@ -2607,7 +2607,7 @@ async fn user_turn_explicit_reasoning_summary_overrides_model_catalog_default()
session_configured,
..
} = test_codex()
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(move |config| {
config.model_catalog = Some(model_catalog);
})
@@ -2710,12 +2710,12 @@ async fn reasoning_summary_none_overrides_model_catalog_default() -> anyhow::Res
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.expect("gpt-5.4 exists in bundled models.json");
.find(|model| model.slug == "gpt-5.5")
.expect("gpt-5.5 exists in bundled models.json");
model.default_reasoning_summary = ReasoningSummary::Detailed;
let TestCodex { codex, .. } = test_codex()
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(move |config| {
config.model_reasoning_summary = Some(ReasoningSummary::None);
config.model_catalog = Some(model_catalog);
@@ -2754,7 +2754,7 @@ async fn includes_default_verbosity_in_request() -> anyhow::Result<()> {
sse(vec![ev_response_created("resp1"), ev_completed("resp1")]),
)
.await;
let TestCodex { codex, .. } = test_codex().with_model("gpt-5.4").build(&server).await?;
let TestCodex { codex, .. } = test_codex().with_model("gpt-5.5").build(&server).await?;
codex
.start_or_steer_turn(TurnInputRequest::user_input(vec![UserInput::Text {
@@ -2832,7 +2832,7 @@ async fn configured_verbosity_is_sent() -> anyhow::Result<()> {
)
.await;
let TestCodex { codex, .. } = test_codex()
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(|config| {
config.model_verbosity = Some(Verbosity::High);
})
+23 -16
View File
@@ -1384,10 +1384,10 @@ if (!tool) {
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.expect("gpt-5.4 exists in bundled models.json");
.find(|model| model.slug == "gpt-5.5")
.expect("gpt-5.5 exists in bundled models.json");
config.chatgpt_base_url = apps_base_url;
config.model = Some("gpt-5.4".to_string());
config.model = Some("gpt-5.5".to_string());
model.supports_search_tool = true;
config.model_catalog = Some(model_catalog);
});
@@ -1879,7 +1879,7 @@ text(JSON.stringify([results[0].output.includes("code-alpha-ready"), results[1].
// This model uses token-based tool-output truncation, giving the downstream
// history assertions a stable `…N tokens truncated…` marker.
const TOKEN_POLICY_TEST_MODEL: &str = "gpt-5.4";
const TOKEN_POLICY_TEST_MODEL: &str = "gpt-5.5";
// A nested `exec_command` limit applies to `result.output` inside JavaScript.
// The outer code-mode and history budgets apply after the script calls `text`.
@@ -4079,7 +4079,7 @@ async fn code_mode_resizes_explicit_original_image() -> Result<()> {
&server,
"use exec to return a large original-detail image",
&code,
"gpt-5.4",
"gpt-5.5",
|_| {},
)
.await?;
@@ -4138,7 +4138,7 @@ image({{
&server,
"emit images with legacy detail arguments and MCP metadata",
&code,
"gpt-5.4",
"gpt-5.5",
|config| {
let _ = config.features.enable(Feature::UnifiedImageBudget);
},
@@ -4183,14 +4183,21 @@ async fn code_mode_unified_image_budget_preserves_legacy_contract_for_unsupporte
skip_if_no_network!(Ok(()));
let server = responses::start_mock_server().await;
let (_test, second_mock) = run_code_mode_turn_with_model_and_config(
&server,
"emit an image on a legacy model",
r#"image("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGP4z8DwHwAFAAH/iZk9HQAAAABJRU5ErkJggg==");"#,
"gpt-5.2",
|config| {
let builder = test_codex()
.with_model_info_override("image-budget-unsupported-model", |model| {
model.tool_mode = Some(ToolMode::CodeMode);
model.supports_image_detail_original = false;
})
.with_config(|config| {
let _ = config.features.enable(Feature::CodeMode);
let _ = config.features.enable(Feature::ExecutedToolCallMetadata);
let _ = config.features.enable(Feature::UnifiedImageBudget);
},
});
let (_test, second_mock) = run_code_mode_turn_with_builder(
&server,
"emit an image on a model without original-detail support",
r#"image("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGP4z8DwHwAFAAH/iZk9HQAAAABJRU5ErkJggg==");"#,
builder,
)
.await?;
@@ -4219,7 +4226,7 @@ async fn code_mode_view_image_rejects_invalid_file_without_exposing_contents() -
let server = responses::start_mock_server().await;
let builder = test_codex()
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(|config| {
let _ = config.features.enable(Feature::CodeMode);
})
@@ -4268,7 +4275,7 @@ async fn code_mode_can_use_view_image_result_with_image_helper(
let server = responses::start_mock_server().await;
let mut builder = test_codex()
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(move |config| {
let _ = config.features.enable(Feature::CodeMode);
if unified_image_budget {
@@ -4404,7 +4411,7 @@ image(imageItem);
&server,
"use exec to call the rmcp image scenario tool and emit its image output",
code,
"gpt-5.4",
"gpt-5.5",
)
.await?;
+4 -1
View File
@@ -407,9 +407,12 @@ fn model_info_with_context_window(slug: &str, context_window: i64) -> ModelInfo
let mut model_info = models_response
.models
.into_iter()
.find(|model| model.slug == slug)
.find(|model| model.slug == "gpt-5.5")
.expect("model missing from models.json");
model_info.slug = slug.to_string();
model_info.context_window = Some(context_window);
model_info.max_context_window = Some(context_window);
model_info.comp_hash = None;
model_info
}
+51 -35
View File
@@ -166,6 +166,15 @@ fn test_model_info(
}
}
fn configure_model_switching_fixture(model: &mut ModelInfo) {
// Exercise model selection and history without changing the request transport,
// starting Code Mode, or compacting the mocked history on a model switch.
model.tool_mode = None;
model.multi_agent_version = None;
model.use_responses_lite = false;
model.comp_hash = None;
}
#[test_case(None; "model only")]
#[test_case(Some(Personality::Pragmatic); "model and personality")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
@@ -177,14 +186,16 @@ async fn first_turn_model_change_appends_model_instructions_developer_message(
let server = MockServer::start().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.2").with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
});
let mut builder = test_codex()
.with_model_info_override("gpt-5.6-terra", configure_model_switching_fixture)
.with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
});
let test = builder.build_with_auto_env(&server).await?;
let next_model = "gpt-5.4";
let next_model = "gpt-5.5";
submit_model_turn(
&test.codex,
@@ -220,10 +231,10 @@ async fn first_turn_model_change_appends_model_instructions_developer_message(
Ok(())
}
#[test_case(None, "gpt-5.2"; "model-generated base instructions and original model")]
#[test_case(None, "gpt-5.4"; "model-generated base instructions and fork model")]
#[test_case(Some("inherited custom base instructions"), "gpt-5.2"; "custom base instructions and original model")]
#[test_case(Some("inherited custom base instructions"), "gpt-5.4"; "custom base instructions and fork model")]
#[test_case(None, "gpt-5.6-terra"; "model-generated base instructions and original model")]
#[test_case(None, "gpt-5.5"; "model-generated base instructions and fork model")]
#[test_case(Some("inherited custom base instructions"), "gpt-5.6-terra"; "custom base instructions and original model")]
#[test_case(Some("inherited custom base instructions"), "gpt-5.5"; "custom base instructions and fork model")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn first_turn_after_empty_prefix_fork_preserves_inherited_base_instructions(
custom_base_instructions: Option<&'static str>,
@@ -234,9 +245,9 @@ async fn first_turn_after_empty_prefix_fork_preserves_inherited_base_instruction
let server = MockServer::start().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-fork")).await;
let initial_model = "gpt-5.2";
let initial_model = "gpt-5.6-terra";
let mut builder = test_codex()
.with_model(initial_model)
.with_model_info_override(initial_model, configure_model_switching_fixture)
.with_config(move |config| {
config.base_instructions = custom_base_instructions.map(str::to_string);
});
@@ -260,7 +271,7 @@ async fn first_turn_after_empty_prefix_fork_preserves_inherited_base_instruction
);
let mut fork_config = test.config.clone();
fork_config.model = Some("gpt-5.4".to_string());
fork_config.model = Some("gpt-5.5".to_string());
fork_config.base_instructions = None;
let fork = test
.thread_manager
@@ -337,13 +348,13 @@ async fn rollback_first_turn_model_change_removes_its_instructions(
)
.await;
let initial_model = "gpt-5.2";
let switched_model = "gpt-5.4";
let initial_model = "gpt-5.6-terra";
let switched_model = "gpt-5.5";
let rollback_ready = Arc::new(RollbackReady::default());
let mut extensions = ExtensionRegistryBuilder::new();
extensions.thread_lifecycle_contributor(rollback_ready.clone());
let mut builder = test_codex()
.with_model(initial_model)
.with_model_info_override(initial_model, configure_model_switching_fixture)
.with_extensions(Arc::new(extensions.build()));
let test = builder.build_with_auto_env(&server).await?;
@@ -368,7 +379,9 @@ async fn rollback_first_turn_model_change_removes_its_instructions(
let test = match followup {
RollbackFollowup::ColdResume => {
let mut resume_builder = test_codex().with_model(switched_model);
let mut resume_builder = test_codex()
.with_model_info_override(initial_model, configure_model_switching_fixture)
.with_model(switched_model);
resume_builder.restart(&server, &test).await?
}
RollbackFollowup::StartupModel | RollbackFollowup::SwitchedModel => test,
@@ -425,9 +438,10 @@ async fn model_change_appends_model_instructions_developer_message() -> Result<(
)
.await;
let mut builder = test_codex().with_model("gpt-5.2");
let mut builder =
test_codex().with_model_info_override("gpt-5.6-terra", configure_model_switching_fixture);
let test = builder.build(&server).await?;
let next_model = "gpt-5.4";
let next_model = "gpt-5.5";
test.codex
.start_or_steer_turn(read_only_user_turn(
@@ -516,7 +530,7 @@ async fn model_and_personality_change_only_appends_model_instructions() -> Resul
)
.await;
let mut builder = test_codex().with_model("gpt-5.4").with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
@@ -624,16 +638,18 @@ async fn settings_update_during_active_turn_applies_to_next_turn_only() -> Resul
],
)
.await;
let mut builder = test_codex().with_model("gpt-5.2").with_config(|config| {
config
.features
.enable(Feature::DefaultModeRequestUserInput)
.expect("test config should allow feature update");
config.model_reasoning_effort = Some(ReasoningEffort::Low);
config.model_reasoning_summary = Some(ReasoningSummary::Concise);
config.permissions.approval_policy = Constrained::allow_any(AskForApproval::OnRequest);
config.approvals_reviewer = ApprovalsReviewer::User;
});
let mut builder = test_codex()
.with_model_info_override("gpt-5.6-terra", configure_model_switching_fixture)
.with_config(|config| {
config
.features
.enable(Feature::DefaultModeRequestUserInput)
.expect("test config should allow feature update");
config.model_reasoning_effort = Some(ReasoningEffort::Low);
config.model_reasoning_summary = Some(ReasoningSummary::Concise);
config.permissions.approval_policy = Constrained::allow_any(AskForApproval::OnRequest);
config.approvals_reviewer = ApprovalsReviewer::User;
});
let test = builder.build_with_auto_env(&server).await?;
test.codex
@@ -651,7 +667,7 @@ async fn settings_update_during_active_turn_applies_to_next_turn_only() -> Resul
core_test_support::submit_thread_settings(
&test.codex,
ThreadSettingsOverrides {
model: Some("gpt-5.4".to_string()),
model: Some("gpt-5.5".to_string()),
effort: Some(Some(ReasoningEffort::High)),
summary: Some(ReasoningSummary::Detailed),
service_tier: Some(Some(ServiceTier::Fast.request_value().to_string())),
@@ -701,19 +717,19 @@ async fn settings_update_during_active_turn_applies_to_next_turn_only() -> Resul
request_settings,
vec![
json!({
"model": "gpt-5.2",
"model": "gpt-5.6-terra",
"reasoning": { "effort": "low", "summary": "concise" },
"service_tier": null,
"approval_policy_never": false,
}),
json!({
"model": "gpt-5.2",
"model": "gpt-5.6-terra",
"reasoning": { "effort": "low", "summary": "concise" },
"service_tier": null,
"approval_policy_never": false,
}),
json!({
"model": "gpt-5.4",
"model": "gpt-5.5",
"reasoning": { "effort": "high", "summary": "detailed" },
"service_tier": "priority",
"approval_policy_never": true,
@@ -514,7 +514,7 @@ async fn snapshot_model_visible_layout_resume_with_personality_change() -> Resul
.with_extensions(skills_extensions())
.with_config(|config| {
config.update_plan_enabled = true;
config.model = Some("gpt-5.2".to_string());
config.model = Some("gpt-5.5".to_string());
});
let initial = initial_builder.build(&server).await?;
let codex = Arc::clone(&initial.codex);
@@ -26,7 +26,7 @@ async fn auth_and_provider_switches_do_not_reuse_chatgpt_catalog() -> Result<()>
let mut model = bundled_models_response()?
.models
.into_iter()
.find(|model| model.slug == "gpt-5.4")
.find(|model| model.slug == "gpt-5.5")
.unwrap();
model.visibility = ModelVisibility::List;
model.default_service_tier = Some("priority".into());
@@ -40,7 +40,7 @@ async fn auth_and_provider_switches_do_not_reuse_chatgpt_catalog() -> Result<()>
let chatgpt = test_codex()
.with_home(home.clone())
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.build_with_auto_env(&server)
.await?;
assert!(home.path().join("models_cache.json").exists());
@@ -77,7 +77,7 @@ async fn auth_and_provider_switches_do_not_reuse_chatgpt_catalog() -> Result<()>
let api = test_codex()
.with_home(home.clone())
.with_auth(CodexAuth::from_api_key("api-key"))
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.build_with_auto_env(&server)
.await?;
let ordinary = responses::mount_sse_once(
@@ -124,7 +124,7 @@ async fn auth_and_provider_switches_do_not_reuse_chatgpt_catalog() -> Result<()>
let other = test_codex()
.with_home(home)
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(|config| {
config.model_provider_id = "second".into();
config.model_provider.name = "Second".into();
+12 -11
View File
@@ -44,6 +44,7 @@ use wiremock::MockServer;
const LOCAL_FRIENDLY_TEMPLATE: &str =
"You optimize for team morale and being a supportive teammate as much as code quality.";
const BUNDLED_FRIENDLY_TEMPLATE: &str = "You have a vivid inner life as Codex:";
const LOCAL_PRAGMATIC_TEMPLATE: &str = "You are a deeply pragmatic, effective software engineer.";
fn read_only_text_turn(
@@ -93,7 +94,7 @@ async fn user_turn_personality_none_does_not_add_update_message() -> anyhow::Res
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.4").with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
@@ -130,7 +131,7 @@ async fn config_personality_some_sets_instructions_template() -> anyhow::Result<
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.4").with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
@@ -154,7 +155,7 @@ async fn config_personality_some_sets_instructions_template() -> anyhow::Result<
let instructions_text = request.instructions_text();
assert!(
instructions_text.contains(LOCAL_FRIENDLY_TEMPLATE),
instructions_text.contains(BUNDLED_FRIENDLY_TEMPLATE),
"expected personality update to include the local friendly template, got: {instructions_text:?}"
);
@@ -175,7 +176,7 @@ async fn config_personality_none_sends_no_personality() -> anyhow::Result<()> {
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.4").with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
@@ -198,7 +199,7 @@ async fn config_personality_none_sends_no_personality() -> anyhow::Result<()> {
let request = resp_mock.single_request();
let instructions_text = request.instructions_text();
assert!(
!instructions_text.contains(LOCAL_FRIENDLY_TEMPLATE),
!instructions_text.contains(BUNDLED_FRIENDLY_TEMPLATE),
"expected no friendly personality template, got: {instructions_text:?}"
);
assert!(
@@ -228,7 +229,7 @@ async fn config_personality_none_strips_baked_personality_section() -> anyhow::R
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex()
.with_model_info_override("gpt-5.4", |model_info| {
.with_model_info_override("gpt-5.5", |model_info| {
if let Some(model_messages) = model_info.model_messages.as_mut() {
model_messages.instructions_template = Some("Base instructions\n# Personality\nBaked personality\n## Writing Style\nNested writing style\n# General\nGeneral instructions".to_string());
model_messages.instructions_variables = None;
@@ -270,7 +271,7 @@ async fn config_personality_none_preserves_explicit_base_instructions() -> anyho
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.4").with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
@@ -305,7 +306,7 @@ async fn default_personality_is_pragmatic_without_config_toml() -> anyhow::Resul
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.4").with_config(|config| {
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
@@ -490,8 +491,8 @@ async fn disabled_personality_sends_remote_default_instructions() -> anyhow::Res
let mut remote_model = bundled_models_response()?
.models
.into_iter()
.find(|model| model.slug == "gpt-5.4")
.expect("bundled gpt-5.4 model");
.find(|model| model.slug == "gpt-5.5")
.expect("bundled gpt-5.5 model");
remote_model.slug = remote_slug.to_string();
if let Some(model_messages) = remote_model.model_messages.as_mut() {
model_messages.instructions_template = Some("remote base\n{{ personality }}".to_string());
@@ -837,7 +838,7 @@ async fn user_turn_personality_remote_model_template_includes_update_message() -
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
config.model = Some("gpt-5.4".to_string());
config.model = Some("gpt-5.5".to_string());
});
let test = builder.build(&server).await?;
+26 -2
View File
@@ -2,17 +2,21 @@
use std::fs;
use std::path::Path;
use std::sync::Arc;
use codex_core::TurnInputRequest;
use codex_core::shell::default_user_shell;
use codex_features::Feature;
use codex_models_manager::bundled_models_response;
use codex_models_manager::collaboration_mode_presets::builtin_collaboration_mode_presets;
use codex_models_manager::manager::StaticModelsManager;
use codex_protocol::config_types::CollaborationMode;
use codex_protocol::config_types::ModeKind;
use codex_protocol::config_types::ReasoningSummary;
use codex_protocol::config_types::Settings;
use codex_protocol::config_types::WebSearchMode;
use codex_protocol::models::PermissionProfile;
use codex_protocol::openai_models::ModelsResponse;
use codex_protocol::openai_models::ReasoningEffort;
use codex_protocol::permissions::NetworkSandboxPolicy;
use codex_protocol::protocol::AskForApproval;
@@ -135,6 +139,25 @@ async fn prompt_tools_are_consistent_across_requests(
const CUSTOM_BASE_INSTRUCTIONS: &str =
"Custom base.\r\n## Plan tool\r\nPreserve this custom workflow.\r\n";
const MODEL_BASE_INSTRUCTIONS: &str = "Model base.\n\n## Planning\nYou have access to an `update_plan` tool which tracks steps.\n\n## Work\nKeep working.\n\n## `update_plan`\nUpdate the plan.\n";
let mut model = bundled_models_response()?
.models
.into_iter()
.find(|model| model.slug == "gpt-5.5")
.expect("bundled gpt-5.5 model");
model
.model_messages
.as_mut()
.expect("bundled model messages")
.instructions_template = Some(MODEL_BASE_INSTRUCTIONS.to_string());
// Supply model instructions without making them an explicit config catalog override.
let models_manager = Arc::new(StaticModelsManager::new(
/*auth_manager*/ None,
ModelsResponse {
models: vec![model],
},
));
let server = start_mock_server().await;
let req1 = mount_sse_once(
@@ -154,9 +177,10 @@ async fn prompt_tools_are_consistent_across_requests(
thread_manager,
..
} = test_codex()
.with_models_manager(models_manager)
.with_pre_build_hook(write_global_instructions)
.with_config(move |config| {
config.model = Some("gpt-5.2".to_string());
config.model = Some("gpt-5.5".to_string());
if let Some(update_plan_enabled) = update_plan_enabled {
config.update_plan_enabled = update_plan_enabled;
}
@@ -220,7 +244,7 @@ async fn prompt_tools_are_consistent_across_requests(
collaboration_mode: Some(CollaborationMode {
mode: ModeKind::Plan,
settings: Settings {
model: "gpt-5.2".to_string(),
model: "gpt-5.5".to_string(),
reasoning_effort: None,
developer_instructions: Some(mode_instructions.clone()),
},
+4 -4
View File
@@ -76,8 +76,8 @@ async fn disabled_update_plan_preserves_custom_catalog_instructions() -> Result<
let model = catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.2")
.expect("bundled gpt-5.2 model");
.find(|model| model.slug == "gpt-5.5")
.expect("bundled gpt-5.5 model");
let messages = model
.model_messages
.as_mut()
@@ -85,7 +85,7 @@ async fn disabled_update_plan_preserves_custom_catalog_instructions() -> Result<
messages.instructions_template = Some(INSTRUCTIONS.to_string());
messages.instructions_variables = None;
let test = test_codex()
.with_model("gpt-5.2")
.with_model("gpt-5.5")
.with_config(move |config| {
config.update_plan_enabled = false;
config.model_catalog = Some(catalog);
@@ -544,7 +544,7 @@ async fn namespaced_model_slug_uses_catalog_metadata_without_fallback_warning()
skip_if_sandbox!(Ok(()));
let server = MockServer::start().await;
let requested_model = "custom/gpt-5.2-codex";
let requested_model = "custom/gpt-5.5-codex";
let response_mock = mount_sse_once(
&server,
sse(vec![ev_response_created("resp-1"), ev_completed("resp-1")]),
@@ -137,10 +137,10 @@ fn configure_apps_without_search_tool(config: &mut Config, apps_base_url: &str)
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.expect("gpt-5.4 exists in bundled models.json");
.find(|model| model.slug == "gpt-5.5")
.expect("gpt-5.5 exists in bundled models.json");
config.chatgpt_base_url = apps_base_url.to_string();
config.model = Some("gpt-5.4".to_string());
config.model = Some("gpt-5.5".to_string());
config.tool_suggest.discoverables = vec![ToolSuggestDiscoverable {
kind: ToolSuggestDiscoverableType::Connector,
id: DISCOVERABLE_GMAIL_ID.to_string(),
@@ -1059,7 +1059,7 @@ async fn run_remote_plugin_install_metadata_case() -> Result<()> {
"source": "endpoint_recommendation",
"thread_id": thread_id,
"turn_id": turn_id,
"model_slug": "gpt-5.4",
"model_slug": "gpt-5.5",
"product_client_id": codex_login::default_client::originator().value,
}
})
+2 -2
View File
@@ -1749,7 +1749,7 @@ async fn stdio_mcp_tool_call_includes_sandbox_state_meta(
let model = models
.models
.iter_mut()
.find(|model| model.slug == "gpt-5.4")
.find(|model| model.slug == "gpt-5.5")
.expect("bundled model should exist");
model.node_repl_auto_review_required = node_repl_auto_review_required;
model.node_repl_disabled = node_repl_disabled;
@@ -1803,7 +1803,7 @@ async fn stdio_mcp_tool_call_includes_sandbox_state_meta(
let rmcp_test_server_bin = remote_aware_stdio_server_bin()?;
let fixture = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_model("gpt-5.4")
.with_model("gpt-5.5")
.with_config(move |config| {
insert_mcp_server(
config,
@@ -310,7 +310,7 @@ async fn model_verification_emits_structured_event_without_reroute_or_warning()
]));
let _mock = mount_response_once(&server, response).await;
let mut builder = test_codex().with_model(SERVER_MODEL);
let mut builder = test_codex().with_model("gpt-5.5");
let test = builder.build(&server).await?;
test.codex
+1 -1
View File
@@ -702,7 +702,7 @@ async fn tool_search_returns_deferred_tools_without_follow_up_tool_injection() -
apps_tool_call
.pointer("/params/_meta/x-codex-turn-metadata/model")
.and_then(Value::as_str),
Some("gpt-5.4")
Some("gpt-5.5")
);
let first_request_reasoning_effort = first_request_body
.pointer("/reasoning/effort")
+2 -2
View File
@@ -121,8 +121,8 @@ fn step_settings_models() -> Vec<ModelInfo> {
.expect("bundled models should parse")
.models
.into_iter()
.find(|model| model.slug == "gpt-5.4")
.expect("bundled gpt-5.4 model");
.find(|model| model.slug == "gpt-5.5")
.expect("bundled gpt-5.5 model");
[MODEL_A, MODEL_B, MODEL_C]
.into_iter()
.map(|slug| {
@@ -66,7 +66,7 @@ async fn ordinary_settings_updates_keep_the_running_turn_snapshot() -> Result<()
.unwrap()
.models
.into_iter()
.find(|model| model.slug == "gpt-5.4")
.find(|model| model.slug == "gpt-5.5")
.unwrap();
config.model_catalog = Some(ModelsResponse {
models: ["snapshot-model-a", "snapshot-model-b"]
@@ -79,15 +79,15 @@ const TURN_0_FORK_PROMPT: &str = "seed fork context";
const TURN_1_PROMPT: &str = "spawn a child and continue";
const TURN_2_NO_WAIT_PROMPT: &str = "follow up without wait";
const CHILD_PROMPT: &str = "child: do work";
const INHERITED_MODEL: &str = "gpt-5.2";
const INHERITED_MODEL: &str = "gpt-5.5";
const INHERITED_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::XHigh;
const REQUESTED_MODEL: &str = "gpt-5.4";
const REQUESTED_MODEL: &str = "gpt-5.6-luna";
const REQUESTED_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::Low;
const V2_DEFAULT_MODEL: &str = "gpt-5.6-terra";
const V2_DEFAULT_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::High;
const V2_REQUESTED_MODEL: &str = "gpt-5.6-sol";
const V2_REQUESTED_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::Low;
const ROLE_MODEL: &str = "gpt-5.4";
const ROLE_MODEL: &str = "gpt-5.5";
const ROLE_REASONING_EFFORT: ReasoningEffort = ReasoningEffort::High;
const SUBAGENT_START_CONTEXT: &str = "subagent start context reaches child";
const SUBAGENT_STOP_CONTINUATION: &str = "continue only the child";
@@ -1024,6 +1024,7 @@ async fn spawned_child_receives_forked_parent_context(
.await;
let mut builder = test_codex()
.with_model_info_override(INHERITED_MODEL, |model| model.comp_hash = None)
.with_history_mode(history_mode)
.with_config(|config| {
config
@@ -1522,6 +1523,9 @@ async fn spawned_full_history_v2_child_uses_model_precedence_without_dropping_co
.iter_mut()
.find(|model_info| model_info.slug == model)
.unwrap_or_else(|| panic!("{model} should exist in bundled models.json"));
if model == INHERITED_MODEL {
model_info.comp_hash = None;
}
let multi_agent = model_info
.model_messages
.as_mut()
@@ -2010,9 +2014,9 @@ async fn spawned_agent_uses_summary_support_for_final_model(
};
assert_eq!(child_body["model"], json!(REQUESTED_MODEL));
let expected_reasoning = if child_supports_summary {
json!({"effort": "medium", "summary": "detailed"})
json!({"effort": "medium", "summary": "detailed", "context": "all_turns"})
} else {
json!({"effort": "medium"})
json!({"effort": "medium", "context": "all_turns"})
};
assert_eq!(child_body["reasoning"], expected_reasoning);
assert_eq!(
@@ -3178,7 +3182,7 @@ async fn spawn_agent_rejects_reasoning_effort_unsupported_by_role_model() -> Res
assert_eq!(
output.as_deref(),
Some(
"Reasoning effort `ultra` is not supported for model `gpt-5.4`. Supported reasoning efforts: low, medium, high, xhigh"
"Reasoning effort `ultra` is not supported for model `gpt-5.5`. Supported reasoning efforts: low, medium, high, xhigh"
)
);
Ok(())
@@ -3251,7 +3255,7 @@ async fn spawn_agent_tool_description_mentions_role_locked_settings() -> Result<
role_block(&agent_type_description, "custom").expect("custom role description");
assert_eq!(
custom_role_description,
"custom: {\nCustom role\n- This role's model is set to `gpt-5.4` and its reasoning effort is set to `high`. These settings cannot be changed.\n}"
"custom: {\nCustom role\n- This role's model is set to `gpt-5.5` and its reasoning effort is set to `high`. These settings cannot be changed.\n}"
);
Ok(())
File diff suppressed because one or more lines are too long
@@ -16,7 +16,7 @@ async fn offline_model_info_without_tool_output_override() {
TestModelsEndpoint::new(Vec::new()),
);
let model_info = manager.get_model_info("gpt-5.2", &config).await;
let model_info = manager.get_model_info("unknown-model", &config).await;
assert_eq!(
model_info.truncation_policy,
@@ -36,7 +36,7 @@ async fn offline_model_info_with_tool_output_override() {
TestModelsEndpoint::new(Vec::new()),
);
let model_info = manager.get_model_info("gpt-5.4", &config).await;
let model_info = manager.get_model_info("gpt-5.5", &config).await;
assert_eq!(
model_info.truncation_policy,
+9 -9
View File
@@ -1449,17 +1449,17 @@ mod tests {
(ReasoningEffortConfig::Ultra, ReasoningEffortConfig::Medium),
] {
let mut app = make_test_app().await;
app.config.model = Some("gpt-5.4".to_string());
app.config.model = Some("gpt-5.5".to_string());
app.config.model_reasoning_effort = Some(configured_effort.clone());
app.chat_widget
.set_reasoning_effort(Some(configured_effort));
let default_effort =
app.on_apply_advanced_reasoning("gpt-5.4", ReasoningEffortConfig::Ultra);
app.on_apply_advanced_reasoning("gpt-5.5", ReasoningEffortConfig::Ultra);
let new_thread_config = app.fresh_session_config();
assert_eq!(default_effort, Some(expected_default_effort.clone()));
assert_eq!(app.chat_widget.current_model(), "gpt-5.4");
assert_eq!(app.chat_widget.current_model(), "gpt-5.5");
assert_eq!(
app.chat_widget.current_reasoning_effort(),
Some(ReasoningEffortConfig::Ultra)
@@ -1469,7 +1469,7 @@ mod tests {
new_thread_config.model.as_deref(),
new_thread_config.model_reasoning_effort,
),
(Some("gpt-5.4"), Some(expected_default_effort))
(Some("gpt-5.5"), Some(expected_default_effort))
);
}
}
@@ -1477,15 +1477,15 @@ mod tests {
#[tokio::test]
async fn conversation_reasoning_keeps_previous_default_for_ultra_only_model() {
let mut app = make_test_app().await;
app.config.model = Some("gpt-5.4".to_string());
app.config.model = Some("gpt-5.5".to_string());
app.config.model_reasoning_effort = Some(ReasoningEffortConfig::Low);
let mut preset = app
.model_catalog
.try_list_models()
.expect("model catalog is infallible")
.into_iter()
.find(|preset| preset.model == "gpt-5.4")
.expect("gpt-5.4 preset");
.find(|preset| preset.model == "gpt-5.5")
.expect("gpt-5.5 preset");
preset.model = "ultra-only".to_string();
preset.default_reasoning_effort = ReasoningEffortConfig::Ultra;
preset.supported_reasoning_efforts = vec![ReasoningEffortPreset {
@@ -1509,7 +1509,7 @@ mod tests {
new_thread_config.model.as_deref(),
new_thread_config.model_reasoning_effort,
),
(Some("gpt-5.4"), Some(ReasoningEffortConfig::Low))
(Some("gpt-5.5"), Some(ReasoningEffortConfig::Low))
);
}
@@ -1526,7 +1526,7 @@ mod tests {
.handle_key_event(KeyEvent::from(KeyCode::BackTab));
let default_effort =
app.on_apply_advanced_reasoning("gpt-5.4", ReasoningEffortConfig::Ultra);
app.on_apply_advanced_reasoning("gpt-5.5", ReasoningEffortConfig::Ultra);
assert_eq!(default_effort, Some(ReasoningEffortConfig::Low));
assert_eq!(
+29 -8
View File
@@ -110,6 +110,31 @@ pub(super) fn emit_system_bwrap_warning(app_event_tx: &AppEventSender, config: &
)));
}
pub(super) fn model_upgrade_for_migration(
model: &str,
available_models: &[ModelPreset],
) -> Option<ModelUpgrade> {
if let Some(preset) = available_models.iter().find(|preset| preset.model == model) {
return preset.upgrade.clone();
}
// Saved selections can outlive their catalog entries. Keep only their migration metadata.
let (target_model, current_name, target_name) = match model {
"gpt-5.4-mini" => ("gpt-5.6-luna", "GPT-5.4 Mini", "GPT-5.6 Luna"),
_ => return None,
};
Some(ModelUpgrade {
id: target_model.to_string(),
migration_config_key: model.to_string(),
model_link: None,
upgrade_copy: None,
migration_markdown: Some(format!(
"{current_name} is no longer available\n\nCodex now uses {target_name} in place of {current_name}. Switch to {target_name} to continue.\n"
)),
retirement_at: None,
})
}
pub(super) fn should_show_model_migration_prompt(
current_model: &str,
target_model: &str,
@@ -133,9 +158,8 @@ pub(super) fn should_show_model_migration_prompt(
return false;
}
if available_models
.iter()
.any(|preset| preset.model == current_model && preset.upgrade.is_some())
if model_upgrade_for_migration(current_model, available_models)
.is_some_and(|upgrade| upgrade.id == target_model)
{
return true;
}
@@ -274,10 +298,7 @@ pub(super) async fn handle_model_migration_prompt_if_needed(
app_event_tx: &AppEventSender,
available_models: &[ModelPreset],
) -> std::io::Result<Option<AppExitInfo>> {
let upgrade = available_models
.iter()
.find(|preset| preset.model == model)
.and_then(|preset| preset.upgrade.as_ref());
let upgrade = model_upgrade_for_migration(model, available_models);
if let Some(ModelUpgrade {
id: target_model,
@@ -286,7 +307,7 @@ pub(super) async fn handle_model_migration_prompt_if_needed(
upgrade_copy,
migration_markdown,
..
}) = upgrade
}) = upgrade.as_ref()
{
if migration_prompt_hidden(local_settings, migration_config_key.as_str()) {
return Ok(None);
+10 -10
View File
@@ -8796,8 +8796,8 @@ async fn selecting_cyber_model_defaults_active_thread_to_auto_review() {
.try_list_models()
.expect("model catalog")
.into_iter()
.find(|model| model.model == "gpt-5.4")
.expect("gpt-5.4 model");
.find(|model| model.model == "gpt-5.5")
.expect("gpt-5.5 model");
model.model_specialty = Some(MODEL_SPECIALTY_CYBER.to_string());
app.model_catalog = Arc::new(ModelCatalog::new(vec![model]));
@@ -8834,7 +8834,7 @@ async fn selecting_cyber_model_defaults_active_thread_to_auto_review() {
&mut tui,
&mut app_server,
AppEvent::ApplyAdvancedReasoning {
model: "gpt-5.4".to_string(),
model: "gpt-5.5".to_string(),
effort: ReasoningEffortConfig::High,
},
)
@@ -8845,7 +8845,7 @@ async fn selecting_cyber_model_defaults_active_thread_to_auto_review() {
app.handle_event(
&mut tui,
&mut app_server,
AppEvent::UpdateModel("gpt-5.4".to_string()),
AppEvent::UpdateModel("gpt-5.5".to_string()),
)
.await
.expect("model selection should succeed");
@@ -8993,8 +8993,8 @@ async fn selecting_cyber_model_falls_back_to_user_when_auto_review_is_unavailabl
.try_list_models()
.expect("model catalog")
.into_iter()
.find(|model| model.model == "gpt-5.4")
.expect("gpt-5.4 model");
.find(|model| model.model == "gpt-5.5")
.expect("gpt-5.5 model");
model.model_specialty = Some(MODEL_SPECIALTY_CYBER.to_string());
app.model_catalog = Arc::new(ModelCatalog::new(vec![model]));
let _ = app.config.features.disable(Feature::GuardianApproval);
@@ -9003,7 +9003,7 @@ async fn selecting_cyber_model_falls_back_to_user_when_auto_review_is_unavailabl
app.active_thread_id = Some(ThreadId::new());
let params = app
.active_thread_model_setting_update_params("gpt-5.4".to_string())
.active_thread_model_setting_update_params("gpt-5.5".to_string())
.expect("active thread should produce update params");
assert_eq!(
@@ -9048,8 +9048,8 @@ async fn selecting_cyber_model_respects_auto_review_requirements() {
.try_list_models()
.expect("model catalog")
.into_iter()
.find(|model| model.model == "gpt-5.4")
.expect("gpt-5.4 model");
.find(|model| model.model == "gpt-5.5")
.expect("gpt-5.5 model");
model.model_specialty = Some(MODEL_SPECIALTY_CYBER.to_string());
app.model_catalog = Arc::new(ModelCatalog::new(vec![model]));
@@ -9074,7 +9074,7 @@ async fn selecting_cyber_model_respects_auto_review_requirements() {
app.handle_event(
&mut tui,
&mut app_server,
AppEvent::UpdateModel("gpt-5.4".to_string()),
AppEvent::UpdateModel("gpt-5.5".to_string()),
)
.await
.expect("model selection should succeed");
@@ -1,6 +1,7 @@
use super::*;
use crate::chatwidget::UserMessage;
use crate::chatwidget::tests::helpers::normalize_snapshot_paths;
use crate::chatwidget::tests::helpers::set_fast_mode_test_catalog_for_models;
use codex_app_server_protocol::GetAccountRateLimitsResponse;
use codex_app_server_protocol::ThreadSettingsUpdateParams;
use pretty_assertions::assert_eq;
@@ -10,9 +11,9 @@ pub(super) fn fallback_response() -> GetAccountRateLimitsResponse {
serde_json::from_value(json!({
"accountId": "workspace-a", "rateLimits": {},
"rateLimitUpsell": {
"banner_type": "model_recovery", "model_slug": "gpt-5.4",
"blocked_model_slug": "gpt-5.4",
"fallback_model_slugs": ["unavailable-model", "gpt-5.4", "gpt-5.2"],
"banner_type": "model_recovery", "model_slug": "gpt-5.5",
"blocked_model_slug": "gpt-5.5",
"fallback_model_slugs": ["unavailable-model", "gpt-5.5", "gpt-5.6-terra"],
"title": "Selected model usage exhausted",
"description": "Add credits to use this model again.",
"presentation": "dismissible",
@@ -24,9 +25,9 @@ pub(super) fn fallback_response() -> GetAccountRateLimitsResponse {
fn configure_fallback_model(app: &mut App) {
set_chatgpt_auth(&mut app.chat_widget);
set_fast_mode_test_catalog(&mut app.chat_widget);
set_fast_mode_test_catalog_for_models(&mut app.chat_widget, "gpt-5.5", "gpt-5.6-terra");
app.model_catalog = app.chat_widget.model_catalog();
app.chat_widget.set_model("gpt-5.4");
app.chat_widget.set_model("gpt-5.5");
}
pub(super) async fn start_fallback_thread(
@@ -65,7 +66,7 @@ async fn backend_banner_fallback_updates_task_settings_and_keeps_notice() -> Res
.set_service_tier(Some(ServiceTier::Fast.request_value().to_string()));
let mut expected_mode = app.chat_widget.effective_collaboration_mode();
assert_eq!(expected_mode.mode, mode_kind);
expected_mode.settings.model = "gpt-5.2".into();
expected_mode.settings.model = "gpt-5.6-terra".into();
expected_mode.settings.reasoning_effort = Some(ReasoningEffortConfig::Medium);
let default_model = app.config.model.clone();
let default_plan_effort = app.config.plan_mode_reasoning_effort.clone();
@@ -99,7 +100,7 @@ async fn backend_banner_fallback_updates_task_settings_and_keeps_notice() -> Res
serde_json::from_value::<ThreadSettingsUpdateParams>(sent[0].params.clone().unwrap())?,
ThreadSettingsUpdateParams {
thread_id: thread_id.to_string(),
model: Some("gpt-5.2".into()),
model: Some("gpt-5.6-terra".into()),
effort: Some(ReasoningEffortConfig::Medium),
collaboration_mode: Some(expected_mode.clone()),
service_tier: Some(Some("default".into())),
@@ -146,7 +147,7 @@ async fn backend_banner_fallback_updates_task_settings_and_keeps_notice() -> Res
healthy.rate_limit_upsell = None;
app.chat_widget.update_backend_banner(&healthy);
app.apply_backend_banner_fallback(&mut server).await;
assert_eq!(app.chat_widget.current_model(), "gpt-5.2");
assert_eq!(app.chat_widget.current_model(), "gpt-5.6-terra");
assert_eq!(requests.lock().unwrap().len(), 1);
assert!(
!std::iter::from_fn(|| events.try_recv().ok())
@@ -166,7 +167,7 @@ async fn backend_banner_fallback_updates_task_settings_and_keeps_notice() -> Res
app.chat_widget
.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE));
assert_matches!(next_user_turn_op(&mut ops), AppCommand::UserTurn { model, collaboration_mode: Some(mode), .. }
if model == "gpt-5.2" && mode == expected_mode);
if model == "gpt-5.6-terra" && mode == expected_mode);
server.shutdown().await?;
proxy.await??;
}
@@ -207,7 +208,7 @@ async fn backend_banner_fallback_uses_current_task_and_accepted_generation() ->
)
.await?;
if generation == read_generation {
assert_eq!(app.chat_widget.current_model(), "gpt-5.4");
assert_eq!(app.chat_widget.current_model(), "gpt-5.5");
assert!(requests.lock().unwrap().is_empty());
}
}
@@ -217,7 +218,7 @@ async fn backend_banner_fallback_uses_current_task_and_accepted_generation() ->
sent[0].params.as_ref().unwrap()["threadId"],
active_id.to_string()
);
assert_eq!(app.chat_widget.current_model(), "gpt-5.2");
assert_eq!(app.chat_widget.current_model(), "gpt-5.6-terra");
server.shutdown().await?;
proxy.await??;
Ok(())
@@ -231,13 +232,13 @@ async fn backend_banner_fallback_keeps_existing_recovery_without_candidate() ->
for (replacement, expect_legacy_banner) in [
(json!([]), true),
(json!(["unavailable-model"]), false),
(json!(["gpt-5.4"]), false),
(json!(["gpt-5.5"]), false),
] {
let mut response = fallback_response();
response.rate_limit_upsell.as_mut().unwrap()["fallback_model_slugs"] = replacement;
app.chat_widget.update_backend_banner(&response);
app.apply_backend_banner_fallback(&mut server).await;
assert_eq!(app.chat_widget.current_model(), "gpt-5.4");
assert_eq!(app.chat_widget.current_model(), "gpt-5.5");
let rendered = render_bottom_popup(&app.chat_widget, /*width*/ 72);
assert_eq!(rendered.contains("View usage"), expect_legacy_banner);
if !expect_legacy_banner {
@@ -247,10 +248,10 @@ async fn backend_banner_fallback_keeps_existing_recovery_without_candidate() ->
);
}
}
app.chat_widget.set_model("gpt-5.2");
app.chat_widget.set_model("gpt-5.6-terra");
app.chat_widget.update_backend_banner(&fallback_response());
app.apply_backend_banner_fallback(&mut server).await;
assert_eq!(app.chat_widget.current_model(), "gpt-5.2");
assert_eq!(app.chat_widget.current_model(), "gpt-5.6-terra");
assert!(
render_bottom_popup(&app.chat_widget, /*width*/ 72)
.contains("Selected model usage exhausted")
@@ -310,7 +311,7 @@ async fn backend_banner_fallback_handles_settings_failure_and_queued_manual_sele
} else {
if settings_requests == 1 {
// A manual selection arriving while the RPC is pending must win afterward.
manual_selection_tx.send(AppEvent::UpdateModel("gpt-5.4".into()));
manual_selection_tx.send(AppEvent::UpdateModel("gpt-5.5".into()));
}
json!({"id": request["id"], "result": {}})
}
@@ -369,7 +370,7 @@ async fn backend_banner_fallback_handles_settings_failure_and_queued_manual_sele
if use_reserve {
"gpt-reserve"
} else {
"gpt-5.2"
"gpt-5.6-terra"
}
);
let manual_selection = queued
@@ -380,7 +381,7 @@ async fn backend_banner_fallback_handles_settings_failure_and_queued_manual_sele
app.handle_event(&mut tui, &mut server, manual_selection)
.await?;
}
assert_eq!(app.chat_widget.current_model(), "gpt-5.4");
assert_eq!(app.chat_widget.current_model(), "gpt-5.5");
assert!(!render_bottom_popup(&app.chat_widget, /*width*/ 72).contains("View usage"));
if use_reserve && error_code.is_some() {
let rendered = render_bottom_popup(&app.chat_widget, /*width*/ 90);
@@ -447,7 +448,7 @@ async fn backend_banner_fallback_preserves_permissions_for_first_eligible_cyber_
let mut models = app.model_catalog.try_list_models()?;
let mut cyber_model = models
.iter()
.find(|model| model.model == "gpt-5.2")
.find(|model| model.model == "gpt-5.6-terra")
.unwrap()
.clone();
// Like the manual-selection tests, classify a fixture model through catalog metadata.
@@ -465,12 +466,16 @@ async fn backend_banner_fallback_preserves_permissions_for_first_eligible_cyber_
app.replace_chat_widget(ChatWidget::new_with_app_event(init));
app.chat_widget
.handle_thread_session(app.primary_session_configured.clone().unwrap());
app.chat_widget.set_model("gpt-5.4");
app.chat_widget.set_model("gpt-5.5");
app.chat_widget
.set_reasoning_effort(Some(ReasoningEffortConfig::Medium));
let mut response = fallback_response();
response.rate_limit_upsell.as_mut().unwrap()["fallback_model_slugs"] =
json!(["unavailable-model", "gpt-5.4", cyber_model.model, "gpt-5.2"]);
response.rate_limit_upsell.as_mut().unwrap()["fallback_model_slugs"] = json!([
"unavailable-model",
"gpt-5.5",
cyber_model.model,
"gpt-5.6-terra"
]);
app.chat_widget.update_backend_banner(&response);
app.apply_backend_banner_fallback(&mut server).await;
assert_eq!(app.chat_widget.current_model(), cyber_model.model);
@@ -1,13 +1,14 @@
use super::backend_banner_fallback_tests::fallback_response;
use super::*;
use crate::chatwidget::UserMessage;
use crate::chatwidget::tests::helpers::set_fast_mode_test_catalog_for_models;
use pretty_assertions::assert_eq;
#[tokio::test]
async fn backend_banner_fallback_applies_before_initial_and_queued_startup_prompts() -> Result<()> {
let (mut app, mut events, _ops) = make_test_app_with_channels().await;
let mut config = app.config.clone();
config.model = Some("gpt-5.4".into());
config.model = Some("gpt-5.5".into());
let mut tui = crate::tui::test_support::make_test_tui()?;
let init = app.chatwidget_init_for_forked_or_resumed_thread(
&mut tui,
@@ -16,10 +17,10 @@ async fn backend_banner_fallback_applies_before_initial_and_queued_startup_promp
);
app.replace_chat_widget(ChatWidget::new_with_app_event(init));
set_chatgpt_auth(&mut app.chat_widget);
set_fast_mode_test_catalog(&mut app.chat_widget);
set_fast_mode_test_catalog_for_models(&mut app.chat_widget, "gpt-5.5", "gpt-5.6-terra");
app.model_catalog = app.chat_widget.model_catalog();
app.pending_startup_thread_start = true;
app.chat_widget.set_model("gpt-5.4");
app.chat_widget.set_model("gpt-5.5");
app.chat_widget
.set_queue_submissions_until_session_configured(/*queue*/ true);
app.chat_widget
@@ -68,7 +69,7 @@ async fn backend_banner_fallback_applies_before_initial_and_queued_startup_promp
assert_eq!(
submissions,
vec![(
"gpt-5.2".into(),
"gpt-5.6-terra".into(),
vec![UserInput::Text {
text: "initial prompt".into(),
text_elements: Vec::new(),
@@ -29,7 +29,7 @@ pub(super) fn configure_reserve_catalog(app: &mut App) {
let mut models = app.model_catalog.try_list_models().unwrap();
let mut reserve = models
.iter()
.find(|model| model.model == "gpt-5.4")
.find(|model| model.model == "gpt-5.5")
.unwrap()
.clone();
reserve.model = "gpt-reserve".into();
@@ -37,7 +37,7 @@ pub(super) fn configure_reserve_catalog(app: &mut App) {
models.push(reserve);
let original = models
.iter_mut()
.find(|model| model.model == "gpt-5.4")
.find(|model| model.model == "gpt-5.5")
.unwrap();
let mut high = original.supported_reasoning_efforts[0].clone();
high.effort = ReasoningEffortConfig::High;
@@ -54,7 +54,7 @@ pub(super) fn configure_reserve_catalog(app: &mut App) {
app.replace_chat_widget(ChatWidget::new_with_app_event(init));
app.chat_widget
.handle_thread_session(app.primary_session_configured.clone().unwrap());
app.chat_widget.set_model("gpt-5.4");
app.chat_widget.set_model("gpt-5.5");
}
#[tokio::test]
@@ -87,7 +87,7 @@ async fn luna_reserve_recovery_survives_task_reconstruction() -> Result<()> {
recovered.rate_limit_upsell = None;
app.chat_widget.update_backend_banner(&recovered);
app.apply_backend_banner_fallback(&mut server).await;
assert_eq!(app.chat_widget.current_model(), "gpt-5.4");
assert_eq!(app.chat_widget.current_model(), "gpt-5.5");
assert_eq!(
app.chat_widget.current_reasoning_effort(),
Some(ReasoningEffortConfig::High)
@@ -236,8 +236,8 @@ async fn luna_reserve_recovery_restores_task_and_pending_turn_after_fresh_backen
// A rounded percentage is not an authorization decision; backend allowed=true wins.
for (request_id, hard_stop_generation, expected) in [
(2, generation.wrapping_sub(1), "gpt-reserve"),
(3, generation, "gpt-5.4"),
(4, generation, "gpt-5.4"),
(3, generation, "gpt-5.5"),
(4, generation, "gpt-5.5"),
] {
app.handle_event(
&mut tui,
@@ -260,7 +260,7 @@ async fn luna_reserve_recovery_restores_task_and_pending_turn_after_fresh_backen
app.chat_widget
.apply_reserve_fallback_to_pending_turn(&mut pending);
assert_matches!(pending, AppCommand::UserTurn { model, effort, collaboration_mode, .. }
if model == "gpt-5.4" && effort == original_mode.reasoning_effort()
if model == "gpt-5.5" && effort == original_mode.reasoning_effort()
&& collaboration_mode == Some(original_mode.clone()));
let sent = requests.lock().unwrap().clone();
assert_eq!(sent.len(), 2);
@@ -270,7 +270,7 @@ async fn luna_reserve_recovery_restores_task_and_pending_turn_after_fresh_backen
restored,
ThreadSettingsUpdateParams {
thread_id: app.active_thread_id.unwrap().to_string(),
model: Some("gpt-5.4".into()),
model: Some("gpt-5.5".into()),
effort: Some(ReasoningEffortConfig::High),
collaboration_mode: Some(original_mode),
service_tier: None,
@@ -341,7 +341,7 @@ async fn luna_reserve_recovery_requires_permission_and_no_remaining_blocker() ->
app.chat_widget.clear_backend_banner();
app.chat_widget.update_backend_banner(&recovered);
app.apply_backend_banner_fallback(&mut server).await;
assert_eq!(app.chat_widget.current_model(), "gpt-5.4");
assert_eq!(app.chat_widget.current_model(), "gpt-5.5");
assert_eq!(requests.lock().unwrap().len(), 1);
server.shutdown().await?;
proxy.await??;
@@ -365,8 +365,8 @@ async fn luna_reserve_recovery_does_not_override_manual_choice_or_account_change
recovered.account_id = Some("workspace-b".into());
"gpt-reserve"
} else {
app.chat_widget.set_model("gpt-5.2");
"gpt-5.2"
app.chat_widget.set_model("gpt-5.6-terra");
"gpt-5.6-terra"
};
app.chat_widget.update_backend_banner(&recovered);
app.apply_backend_banner_fallback(&mut server).await;
+171 -116
View File
@@ -18,7 +18,7 @@ async fn model_picker_refresh_updates_app_catalog_from_app_server() -> Result<()
let fast = Some(ServiceTier::Fast.request_value());
let thread_id = ThreadId::new();
let mut session = test_thread_session(thread_id, test_path_buf("/tmp/project"));
session.model = "gpt-5.4".to_string();
session.model = "gpt-5.5".to_string();
app.primary_thread_id = Some(thread_id);
app.active_thread_id = Some(thread_id);
app.primary_session_configured = Some(session.clone());
@@ -72,7 +72,7 @@ async fn model_picker_refresh_updates_app_catalog_from_app_server() -> Result<()
};
assert!(!models.is_empty());
for model in models.iter_mut() {
model.is_default = model.model == "gpt-5.4";
model.is_default = model.model == "gpt-5.5";
model.default_service_tier = model
.is_default
.then(|| ServiceTier::Fast.request_value().to_string());
@@ -111,7 +111,7 @@ async fn model_picker_refresh_updates_app_catalog_from_app_server() -> Result<()
let mut config = app.config.clone();
config.service_tier = None;
config.features.enable(Feature::FastMode)?;
for (model, expected_tier) in [(None, fast), (Some("gpt-5.2"), Some("default"))] {
for (model, expected_tier) in [(None, fast), (Some("gpt-5.6-terra"), Some("default"))] {
config.model = model.map(str::to_string);
let started = app_server.start_thread(&config).await?;
assert_eq!(started.session.service_tier.as_deref(), expected_tier);
@@ -122,20 +122,23 @@ async fn model_picker_refresh_updates_app_catalog_from_app_server() -> Result<()
fn model_presets_with_test_upgrades() -> Vec<ModelPreset> {
let mut presets = all_model_presets();
for model in ["gpt-5.2", "gpt-5.4"] {
let preset = presets
.iter_mut()
.find(|preset| preset.model == model)
.unwrap_or_else(|| panic!("{model} preset present"));
preset.upgrade = Some(ModelUpgrade {
id: "gpt-5.5".to_string(),
migration_config_key: "hide_test_migration_prompt".to_string(),
model_link: None,
upgrade_copy: None,
migration_markdown: None,
retirement_at: None,
});
}
let mut preset = presets
.iter()
.find(|preset| preset.model == "gpt-5.5")
.expect("current model template")
.clone();
// Catalog-provided migration metadata is independent of the retired model's prompts.
preset.id = "gpt-5.2".to_string();
preset.model = "gpt-5.2".to_string();
preset.upgrade = Some(ModelUpgrade {
id: "gpt-5.5".to_string(),
migration_config_key: "hide_test_migration_prompt".to_string(),
model_link: None,
upgrade_copy: None,
migration_markdown: None,
retirement_at: None,
});
presets.push(preset);
presets
}
@@ -175,13 +178,39 @@ async fn model_migration_prompt_only_shows_for_deprecated_models() {
"gpt-5.2", "gpt-5.5", &seen, &presets
));
assert!(should_show_model_migration_prompt(
"gpt-5.4", "gpt-5.5", &seen, &presets
"gpt-5.4",
"gpt-5.6-terra",
&seen,
&presets
));
assert!(!should_show_model_migration_prompt(
"gpt-5.4", "gpt-5.4", &seen, &presets
));
}
#[test]
fn retired_model_migration_respects_catalog_metadata() {
let mut presets = model_presets_with_test_upgrades();
let current = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.2")
.expect("test preset");
current.id = "gpt-5.4-mini".to_string();
current.model = "gpt-5.4-mini".to_string();
let expected = current.upgrade.clone();
assert_eq!(
model_upgrade_for_migration("gpt-5.4-mini", &presets),
expected
);
presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4-mini")
.expect("catalog preset")
.upgrade = None;
assert_eq!(model_upgrade_for_migration("gpt-5.4-mini", &presets), None);
}
#[test]
fn select_model_availability_nux_picks_only_eligible_model() {
let mut presets = all_model_presets();
@@ -190,10 +219,10 @@ fn select_model_availability_nux_picks_only_eligible_model() {
});
let target = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4")
.find(|preset| preset.model == "gpt-5.6-terra")
.expect("target preset present");
target.availability_nux = Some(ModelAvailabilityNux {
message: "gpt-5.4 is available".to_string(),
message: "gpt-5.6-terra is available".to_string(),
});
let selected = select_model_availability_nux(&presets, &model_availability_nux_config(&[]));
@@ -201,8 +230,8 @@ fn select_model_availability_nux_picks_only_eligible_model() {
assert_eq!(
selected,
Some(StartupTooltipOverride {
model_slug: "gpt-5.4".to_string(),
message: "gpt-5.4 is available".to_string(),
model_slug: "gpt-5.6-terra".to_string(),
message: "gpt-5.6-terra is available".to_string(),
})
);
}
@@ -215,22 +244,22 @@ fn select_model_availability_nux_does_not_fall_back_to_older_announcement() {
});
let gpt_5 = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4")
.expect("gpt-5.4 preset present");
.find(|preset| preset.model == "gpt-5.6-terra")
.expect("gpt-5.6-terra preset present");
gpt_5.availability_nux = Some(ModelAvailabilityNux {
message: "gpt-5.4 is available".to_string(),
message: "gpt-5.6-terra is available".to_string(),
});
let gpt_5_2 = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4-mini")
.expect("gpt-5.4-mini preset present");
.find(|preset| preset.model == "gpt-5.5")
.expect("gpt-5.5 preset present");
gpt_5_2.availability_nux = Some(ModelAvailabilityNux {
message: "gpt-5.4-mini is available".to_string(),
message: "gpt-5.5 is available".to_string(),
});
let selected = select_model_availability_nux(
&presets,
&model_availability_nux_config(&[("gpt-5.4", MODEL_AVAILABILITY_NUX_MAX_SHOW_COUNT)]),
&model_availability_nux_config(&[("gpt-5.6-terra", MODEL_AVAILABILITY_NUX_MAX_SHOW_COUNT)]),
);
assert_eq!(selected, None);
@@ -244,15 +273,15 @@ fn select_model_availability_nux_uses_existing_model_order_as_priority() {
});
let first = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4-mini")
.expect("gpt-5.4-mini preset present");
.find(|preset| preset.model == "gpt-5.5")
.expect("gpt-5.5 preset present");
first.availability_nux = Some(ModelAvailabilityNux {
message: "first".to_string(),
});
let second = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4")
.expect("gpt-5.4 preset present");
.find(|preset| preset.model == "gpt-5.6-terra")
.expect("gpt-5.6-terra preset present");
second.availability_nux = Some(ModelAvailabilityNux {
message: "second".to_string(),
});
@@ -262,7 +291,7 @@ fn select_model_availability_nux_uses_existing_model_order_as_priority() {
assert_eq!(
selected,
Some(StartupTooltipOverride {
model_slug: "gpt-5.4".to_string(),
model_slug: "gpt-5.6-terra".to_string(),
message: "second".to_string(),
})
);
@@ -276,15 +305,15 @@ fn select_model_availability_nux_returns_none_when_all_models_are_exhausted() {
});
let target = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4")
.find(|preset| preset.model == "gpt-5.6-terra")
.expect("target preset present");
target.availability_nux = Some(ModelAvailabilityNux {
message: "gpt-5.4 is available".to_string(),
message: "gpt-5.6-terra is available".to_string(),
});
let selected = select_model_availability_nux(
&presets,
&model_availability_nux_config(&[("gpt-5.4", MODEL_AVAILABILITY_NUX_MAX_SHOW_COUNT)]),
&model_availability_nux_config(&[("gpt-5.6-terra", MODEL_AVAILABILITY_NUX_MAX_SHOW_COUNT)]),
);
assert_eq!(selected, None);
@@ -304,10 +333,10 @@ async fn prepare_startup_tooltip_override_persists_model_availability_nux_count(
});
let target = presets
.iter_mut()
.find(|preset| preset.model == "gpt-5.4")
.find(|preset| preset.model == "gpt-5.6-terra")
.expect("target preset present");
target.availability_nux = Some(ModelAvailabilityNux {
message: "gpt-5.4 is available".to_string(),
message: "gpt-5.6-terra is available".to_string(),
});
let mut local_settings = crate::local_settings::LocalSettings::from(&config);
@@ -318,10 +347,10 @@ async fn prepare_startup_tooltip_override_persists_model_availability_nux_count(
)
.await;
assert_eq!(tooltip.as_deref(), Some("gpt-5.4 is available"));
assert_eq!(tooltip.as_deref(), Some("gpt-5.6-terra is available"));
assert_eq!(
local_settings.tui.model_availability_nux.shown_count,
HashMap::from([("gpt-5.4".to_string(), 1)])
HashMap::from([("gpt-5.6-terra".to_string(), 1)])
);
let reloaded = ConfigBuilder::default()
@@ -331,125 +360,151 @@ async fn prepare_startup_tooltip_override_persists_model_availability_nux_count(
.expect("reloaded config");
assert_eq!(
reloaded.model_availability_nux.shown_count,
HashMap::from([("gpt-5.4".to_string(), 1)])
HashMap::from([("gpt-5.6-terra".to_string(), 1)])
);
}
#[tokio::test]
async fn accepted_model_migration_persists_target_default_reasoning_effort() {
let codex_home = tempdir().expect("temp codex home");
let mut config = ConfigBuilder::default()
.codex_home(codex_home.path().to_path_buf())
.build()
.await
.expect("config");
config.model = Some("gpt-5.2".to_string());
config.model_reasoning_effort = Some(ReasoningEffortConfig::XHigh);
async fn accepted_model_migration_persists_target_default_reasoning_effort() -> Result<()> {
let presets = all_model_presets();
let mut migration_copies = Vec::new();
for (model, replacement) in [
("gpt-5.4", "gpt-5.6-terra"),
("gpt-5.4-mini", "gpt-5.6-luna"),
] {
let codex_home = tempdir()?;
std::fs::write(
codex_home.path().join("config.toml"),
format!("model = \"{model}\"\nmodel_reasoning_effort = \"xhigh\"\n"),
)?;
let mut config = ConfigBuilder::default()
.codex_home(codex_home.path().to_path_buf())
.build()
.await?;
let current_model = config.model.clone().expect("saved model");
let upgrade = model_upgrade_for_migration(&current_model, &presets)
.expect("retired selection should still migrate");
assert_eq!(upgrade.id, replacement);
assert!(should_show_model_migration_prompt(
&current_model,
&upgrade.id,
&BTreeMap::new(),
&presets,
));
let target =
target_preset_for_upgrade(&presets, &upgrade.id).expect("available replacement");
let target_effort = target.default_reasoning_effort.clone();
let can_opt_out = presets.iter().any(|preset| preset.model == current_model);
let copy = migration_copy_for_models(
&current_model,
&upgrade.id,
upgrade.model_link,
upgrade.upgrade_copy,
upgrade.migration_markdown,
target.display_name.clone(),
Some(target.description.clone()),
can_opt_out,
);
migration_copies.push(model_migration_copy_to_plain_text(&copy));
let (tx_raw, mut rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(tx_raw);
let (tx_raw, mut rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(tx_raw);
apply_accepted_model_migration(
&mut config,
&app_event_tx,
current_model,
upgrade.id,
target_effort.clone(),
);
apply_accepted_model_migration(
&mut config,
&app_event_tx,
"gpt-5.2".to_string(),
"gpt-5.4".to_string(),
ReasoningEffortConfig::Medium,
);
assert_eq!(config.model.as_deref(), Some(replacement));
assert_eq!(config.model_reasoning_effort, Some(target_effort.clone()));
assert_eq!(config.model.as_deref(), Some("gpt-5.4"));
assert_eq!(
config.model_reasoning_effort,
Some(ReasoningEffortConfig::Medium)
);
let acknowledged = rx.try_recv().expect("acknowledged event");
assert_matches!(
acknowledged,
AppEvent::PersistModelMigrationPromptAcknowledged { from_model, to_model }
if from_model == model && to_model == replacement
);
let acknowledged = rx.try_recv().expect("acknowledged event");
assert_matches!(
acknowledged,
AppEvent::PersistModelMigrationPromptAcknowledged { from_model, to_model }
if from_model == "gpt-5.2" && to_model == "gpt-5.4"
);
let update_model = rx.try_recv().expect("update model event");
assert_matches!(
update_model,
AppEvent::UpdateModel(updated_model) if updated_model == replacement
);
let update_model = rx.try_recv().expect("update model event");
assert_matches!(
update_model,
AppEvent::UpdateModel(model) if model == "gpt-5.4"
);
let update_effort = rx.try_recv().expect("update effort event");
assert_matches!(
update_effort,
AppEvent::UpdateReasoningEffort(Some(effort)) if effort == target_effort
);
let update_effort = rx.try_recv().expect("update effort event");
assert_matches!(
update_effort,
AppEvent::UpdateReasoningEffort(Some(ReasoningEffortConfig::Medium))
);
let persist_selection = rx.try_recv().expect("persist model selection event");
assert_matches!(
persist_selection,
AppEvent::PersistModelSelection { model: selected_model, effort }
if selected_model == replacement && effort == Some(target_effort)
);
}
assert_snapshot!(migration_copies.join("\n"), @r"
GPT-5.4 is no longer available
let persist_selection = rx.try_recv().expect("persist model selection event");
assert_matches!(
persist_selection,
AppEvent::PersistModelSelection { model, effort }
if model == "gpt-5.4" && effort == Some(ReasoningEffortConfig::Medium)
);
Codex now uses GPT-5.6 Terra in place of GPT-5.4. Switch to GPT-5.6 Terra to continue.
GPT-5.4 Mini is no longer available
Codex now uses GPT-5.6 Luna in place of GPT-5.4 Mini. Switch to GPT-5.6 Luna to continue.
");
Ok(())
}
#[tokio::test]
async fn model_migration_prompt_respects_hide_flag_and_self_target() {
let presets = all_model_presets();
let mut seen = BTreeMap::new();
seen.insert("gpt-5.2".to_string(), "gpt-5.4".to_string());
seen.insert("gpt-5.4-mini".to_string(), "gpt-5.6-luna".to_string());
assert!(!should_show_model_migration_prompt(
"gpt-5.2",
"gpt-5.4",
"gpt-5.4-mini",
"gpt-5.6-luna",
&seen,
&all_model_presets()
&presets
));
assert!(!should_show_model_migration_prompt(
"gpt-5.4",
"gpt-5.4",
"gpt-5.6-luna",
"gpt-5.6-luna",
&seen,
&all_model_presets()
&presets
));
}
#[tokio::test]
async fn model_migration_prompt_skips_when_target_missing_or_hidden() {
let mut available = all_model_presets();
let mut current = available
.iter()
.find(|preset| preset.model == "gpt-5.2")
.cloned()
.expect("preset present");
current.upgrade = Some(ModelUpgrade {
id: "missing-target".to_string(),
migration_config_key: HIDE_GPT5_1_MIGRATION_PROMPT_CONFIG.to_string(),
model_link: None,
upgrade_copy: None,
migration_markdown: None,
retirement_at: None,
});
available.retain(|preset| preset.model != "gpt-5.2");
available.push(current.clone());
available.retain(|preset| preset.model != "gpt-5.6-luna");
assert!(!should_show_model_migration_prompt(
&current.model,
"missing-target",
"gpt-5.4-mini",
"gpt-5.6-luna",
&BTreeMap::new(),
&available,
));
assert!(target_preset_for_upgrade(&available, "missing-target").is_none());
assert!(target_preset_for_upgrade(&available, "gpt-5.6-luna").is_none());
let mut with_hidden_target = all_model_presets();
let target = with_hidden_target
.iter_mut()
.find(|preset| preset.model == "gpt-5.4")
.find(|preset| preset.model == "gpt-5.6-luna")
.expect("target preset present");
target.show_in_picker = false;
assert!(!should_show_model_migration_prompt(
"gpt-5.2",
"gpt-5.4",
"gpt-5.4-mini",
"gpt-5.6-luna",
&BTreeMap::new(),
&with_hidden_target,
));
assert!(target_preset_for_upgrade(&with_hidden_target, "gpt-5.4").is_none());
assert!(target_preset_for_upgrade(&with_hidden_target, "gpt-5.6-luna").is_none());
}
#[tokio::test]
@@ -21,7 +21,7 @@ async fn model_default_saves_report_server_outcomes_and_target_server_profile()
loader_overrides.user_config_profile = Some("work".parse()?);
let overrides = if outcome == "overridden" {
vec![
("model".into(), toml::Value::String("gpt-5.2".into())),
("model".into(), toml::Value::String("gpt-5.6-terra".into())),
(
"model_reasoning_effort".into(),
toml::Value::String("low".into()),
@@ -69,7 +69,7 @@ async fn model_default_saves_report_server_outcomes_and_target_server_profile()
let mut tui = crate::tui::test_support::make_test_tui()?;
for event in [
AppEvent::PersistModelSelection {
model: "gpt-5.4".into(),
model: "gpt-5.5".into(),
effort: Some(ReasoningEffortConfig::High),
},
AppEvent::PersistPlanModeReasoningEffort(Some(ReasoningEffortConfig::High)),
@@ -77,7 +77,7 @@ async fn model_default_saves_report_server_outcomes_and_target_server_profile()
service_tier: Some(ServiceTier::Fast.request_value().into()),
},
AppEvent::ApplyAdvancedReasoning {
model: "gpt-5.4".into(),
model: "gpt-5.5".into(),
effort: ReasoningEffortConfig::Ultra,
},
] {
@@ -112,7 +112,7 @@ async fn model_default_saves_report_server_outcomes_and_target_server_profile()
assert_eq!(
toml::from_str::<toml::Value>(&persisted)?,
toml::Value::Table(toml::toml! {
model = "gpt-5.4"
model = "gpt-5.5"
model_reasoning_effort = "medium"
plan_mode_reasoning_effort = "high"
service_tier = "fast"
+17 -2
View File
@@ -7,6 +7,7 @@ use codex_app_server_client::AppServerEvent;
use codex_app_server_protocol::ModelSafetyBufferingUpdatedNotification;
use codex_model_provider_info::ModelProviderInfo;
use codex_protocol::models::ManagedFileSystemPermissions;
use codex_protocol::openai_models::ToolMode;
use codex_protocol::permissions::FileSystemAccessMode;
use codex_protocol::permissions::FileSystemPath;
use codex_protocol::permissions::FileSystemSandboxEntry;
@@ -25,8 +26,8 @@ use pretty_assertions::assert_eq;
use serde_json::Value;
use tokio::sync::oneshot;
const CURRENT_MODEL: &str = "gpt-5.2";
const FASTER_MODEL: &str = "gpt-5.4";
const CURRENT_MODEL: &str = "gpt-5.6-terra";
const FASTER_MODEL: &str = "gpt-5.6-luna";
const MODEL_PROVIDER_ID: &str = "safety-retry-test";
const PREVIOUS_PROMPT: &str = "Establish context";
const RETRY_PROMPT: &str = "Handle the safety-buffered request";
@@ -510,12 +511,25 @@ async fn run_safety_retry(
let (mut app, mut app_event_rx, _op_rx) = make_test_app_with_channels().await;
let codex_home = tempdir()?;
// Keep text-only retry fixtures independent of the optional Code Mode host.
let mut model_catalog = codex_models_manager::bundled_models_response()?;
for model in model_catalog
.models
.iter_mut()
.filter(|model| matches!(model.slug.as_str(), CURRENT_MODEL | FASTER_MODEL))
{
model.tool_mode = Some(ToolMode::Direct);
}
let model_catalog_path = codex_home.path().join("models.json");
std::fs::write(&model_catalog_path, serde_json::to_vec(&model_catalog)?)?;
let model_catalog_path = toml::Value::String(model_catalog_path.display().to_string());
std::fs::write(
codex_home.path().join("config.toml"),
format!(
r#"
model = "{CURRENT_MODEL}"
model_provider = "{MODEL_PROVIDER_ID}"
model_catalog_json = {model_catalog_path}
[model_providers.{MODEL_PROVIDER_ID}]
name = "Safety retry test"
@@ -533,6 +547,7 @@ goals = true
app.config.codex_home = codex_home.path().to_path_buf().abs();
app.config.sqlite = codex_state::SqliteConfig::new_for_testing(codex_home.path().abs());
app.config.model = Some(CURRENT_MODEL.to_string());
app.config.model_catalog = Some(model_catalog);
app.config.model_provider_id = MODEL_PROVIDER_ID.to_string();
app.config.model_provider = ModelProviderInfo {
name: "Safety retry test".to_string(),
@@ -10,4 +10,4 @@ expression: normalize_snapshot_paths(rendered)
› Ask Codex to do anything
gpt-5.2 medium · /tmp/project
gpt-5.6-terra medium · /tmp/project
@@ -1,6 +1,5 @@
---
source: tui/src/app/tests/backend_banner_fallback_tests.rs
assertion_line: 124
expression: "notices[0]"
---
• Automatically switched to gpt-5.2 medium due to usage limits.
• Automatically switched to gpt-5.6-terra medium due to usage limits.
@@ -1,8 +1,7 @@
---
source: tui/src/app/tests/backend_banner_fallback_tests.rs
assertion_line: 234
expression: rendered
expression: normalize_snapshot_paths(rendered)
---
› Ask Codex to do anything
gpt-5.4 default · /tmp/project
gpt-5.5 default · /tmp/project
@@ -2,4 +2,4 @@
source: tui/src/app/tests/luna_reserve_recovery_tests.rs
expression: notice
---
• Automatically switched back to gpt-5.4 high because ordinary usage is available again.
• Automatically switched back to gpt-5.5 high because ordinary usage is available again.
@@ -1,11 +1,10 @@
---
source: tui/src/app/tests/model_defaults_tests.rs
assertion_line: 91
expression: messages
---
⚠ Saved default model and reasoning effort, but a higher-priority configuration
layer overrides the saved value.
• Model changed to gpt-5.4 high
• Model changed to gpt-5.5 high
⚠ Saved Plan mode reasoning effort, but a higher-priority configuration layer
overrides the saved value.
⚠ Saved default service tier, but a higher-priority configuration layer
@@ -13,4 +12,4 @@ expression: messages
• Service tier set to priority
⚠ Saved default model and reasoning effort, but a higher-priority configuration
layer overrides the saved value.
• Model changed to gpt-5.4 ultra for this conversation
• Model changed to gpt-5.5 ultra for this conversation
@@ -44,7 +44,7 @@ async fn cli_fork_omits_implicit_model_and_effort() -> Result<()> {
let home = tempdir()?;
std::fs::write(
home.path().join("config.toml"),
"model = \"gpt-5.2\"\nmodel_reasoning_effort = \"low\"\nfeatures.fast_mode = true\n",
"model = \"gpt-5.5\"\nmodel_reasoning_effort = \"low\"\nfeatures.fast_mode = true\n",
)?;
let config = ConfigBuilder::default()
.codex_home(home.path().to_path_buf())
@@ -76,7 +76,7 @@ async fn cli_fork_omits_implicit_model_and_effort() -> Result<()> {
let client_preset = bootstrap
.available_models
.iter_mut()
.find(|preset| preset.model == "gpt-5.2")
.find(|preset| preset.model == "gpt-5.5")
.expect("client model in catalog");
client_preset.upgrade = Some(codex_protocol::openai_models::ModelUpgrade {
id: "server-model".into(),
@@ -88,7 +88,7 @@ async fn cli_fork_omits_implicit_model_and_effort() -> Result<()> {
});
assert!(
crate::app::startup_prompts::should_show_model_migration_prompt(
"gpt-5.2",
"gpt-5.5",
"server-model",
&Default::default(),
&bootstrap.available_models,
+3 -3
View File
@@ -3466,7 +3466,7 @@ mod tests {
async fn persisted_resume_does_not_forward_implicit_service_tier() -> Result<()> {
let codex_home = tempfile::tempdir().expect("tempdir");
let mut config = build_config(&codex_home).await;
config.model = Some("gpt-5.4".to_string());
config.model = Some("gpt-5.5".to_string());
config.service_tier = None;
config
.features
@@ -3486,8 +3486,8 @@ mod tests {
let mut app_server = crate::start_embedded_app_server_for_picker(&config).await?;
let mut preset = crate::test_support::TEST_MODEL_PRESETS
.iter()
.find(|preset| preset.model == "gpt-5.4")
.expect("gpt-5.4 test preset")
.find(|preset| preset.model == "gpt-5.5")
.expect("gpt-5.5 test preset")
.clone();
preset.service_tiers = vec![ModelServiceTier {
id: ServiceTier::Fast.request_value().to_string(),
@@ -2,7 +2,7 @@
source: tui/src/chatwidget/tests/popups_and_settings.rs
expression: popup
---
Select Reasoning Level for gpt-5.4
Select Reasoning Level for gpt-5.5
› 1. More reasoning… Ultra consumes usage limits faster
@@ -5,9 +5,8 @@ expression: "render_bottom_popup(&chat, 80)"
Select Model and Effort
Access legacy models by running codex -m <model_name> or in your config.toml
› 1. gpt-5.5 Frontier model for complex coding, research, and real-
› 1. gpt-5.6-terra Balanced agentic coding model for everyday work.
2. gpt-5.5 (current) Frontier model for complex coding, research, and real-
world work.
2. gpt-5.2 (current) Optimized for professional work and long-running
agents.
Press enter to confirm or esc to go back
@@ -7,6 +7,6 @@ expression: "render_bottom_popup(&chat, 80)"
1. codex-auto-test Auto model
› 2. All models (current) Choose a specific model and reasoning level
(current: gpt-5.2)
(current: gpt-5.5)
Press enter to confirm or esc to go back
@@ -2,7 +2,7 @@
source: tui/src/chatwidget/tests/popups_and_settings.rs
expression: popup
---
Select Reasoning Level for gpt-5.4
Select Reasoning Level for gpt-5.5
1. Low Fast responses with lighter reasoning
2. Medium (default) Balances speed and reasoning depth for everyday tasks
@@ -1,17 +0,0 @@
---
source: tui/src/chatwidget/tests/popups_and_settings.rs
expression: popup
---
Select Reasoning Level for gpt-5.2
1. Low Balances speed with some reasoning; useful for
straightforward queries and short explanations
2. Medium (default) Provides a solid balance of reasoning depth and
latency for general-purpose tasks
3. High Maximizes reasoning depth for complex or ambiguous
problems
› 4. Extra high (current) Extra high reasoning for complex problems
⚠ Extra high reasoning effort can quickly consume
Plus plan rate limits.
Press enter to confirm or esc to go back
@@ -1,6 +1,6 @@
---
source: tui/src/chatwidget/tests/popups_and_settings.rs
expression: popup
expression: "render_bottom_popup(&chat, 80)"
---
Select Model and Effort
Access legacy models by running codex -m <model_name> or in your config.toml
@@ -10,9 +10,7 @@ expression: popup
2. gpt-5.6-sol Latest frontier agentic coding model.
3. gpt-5.6-terra Balanced agentic coding model for everyday work.
4. gpt-5.6-luna Fast and affordable agentic coding model.
5. gpt-5.5 Frontier model for complex coding, research, and
› 5. gpt-5.5 (current) Frontier model for complex coding, research, and
real-world work.
› 6. gpt-5.2 (current) Optimized for professional work and long-running
agents.
Press enter to confirm or esc to go back
@@ -6,7 +6,7 @@ expression: "render_bottom_popup(&chat,\n100).replace(&directory,\n\"[[workspace
Copy to clipboard
› 1. Whole status >_ OpenAI Codex (vVERSION)
2. Model gpt-5.4
2. Model gpt-5.5
3. Directory [[workspace]]
4. Thread name Clipboard example
5. Session ID 00000000-0000-0000-0000-000000000123
@@ -7,7 +7,7 @@ expression: "whole_status.replace(&directory,\n\"[[workspace]]\").replace(crate:
Visit https://chatgpt.com/codex/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.4 (reasoning medium, summaries auto)
Model: gpt-5.5 (reasoning medium, summaries auto)
Model provider: openai
Directory: [[workspace]]
Permissions: Read Only (Ask for approval)
@@ -187,7 +187,7 @@ fn open_safety_buffering_retry_confirmation(
#[tokio::test]
async fn safety_buffering_offers_one_retry_with_app_wording() {
let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.model = "faster-model".to_string();
preset.display_name = "Faster Model".to_string();
chat.model_catalog = Arc::new(ModelCatalog::new(vec![preset]));
+12 -2
View File
@@ -298,13 +298,23 @@ fn test_model_info(slug: &str, priority: i32, supports_fast_mode: bool) -> Model
}
pub(crate) fn set_fast_mode_test_catalog(chat: &mut ChatWidget) {
set_fast_mode_test_catalog_for_models(chat, "gpt-5.4", "gpt-5.2");
}
pub(crate) fn set_fast_mode_test_catalog_for_models(
chat: &mut ChatWidget,
fast_model: &str,
standard_model: &str,
) {
let models: Vec<ModelPreset> = ModelsResponse {
models: vec![
test_model_info(
"gpt-5.4", /*priority*/ 0, /*supports_fast_mode*/ true,
fast_model, /*priority*/ 0, /*supports_fast_mode*/ true,
),
test_model_info(
"gpt-5.2", /*priority*/ 1, /*supports_fast_mode*/ false,
standard_model,
/*priority*/ 1,
/*supports_fast_mode*/ false,
),
],
}
+45 -45
View File
@@ -259,7 +259,7 @@ async fn submit_user_message_with_mode_sets_coding_collaboration_mode() {
#[tokio::test]
async fn reasoning_selection_in_plan_mode_opens_scope_prompt_event() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
@@ -269,7 +269,7 @@ async fn reasoning_selection_in_plan_mode_opens_scope_prompt_event() {
set_chatgpt_auth(&mut chat);
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
let preset = get_available_model(&chat, "gpt-5.4");
let preset = get_available_model(&chat, "gpt-5.5");
chat.open_reasoning_popup(preset);
chat.handle_key_event(KeyEvent::from(KeyCode::Down));
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
@@ -280,13 +280,13 @@ async fn reasoning_selection_in_plan_mode_opens_scope_prompt_event() {
AppEvent::OpenPlanReasoningScopePrompt {
model,
effort: Some(_)
} if model == "gpt-5.4"
} if model == "gpt-5.5"
);
}
#[tokio::test]
async fn reasoning_selection_in_plan_mode_without_effort_change_does_not_open_scope_prompt_event() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
@@ -297,7 +297,7 @@ async fn reasoning_selection_in_plan_mode_without_effort_change_does_not_open_sc
chat.set_reasoning_effort(Some(ReasoningEffortConfig::Medium));
let preset = get_available_model(&chat, "gpt-5.4");
let preset = get_available_model(&chat, "gpt-5.5");
chat.open_reasoning_popup(preset);
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
@@ -305,7 +305,7 @@ async fn reasoning_selection_in_plan_mode_without_effort_change_does_not_open_sc
assert!(
events.iter().any(|event| matches!(
event,
AppEvent::UpdateModel(model) if model == "gpt-5.4"
AppEvent::UpdateModel(model) if model == "gpt-5.5"
)),
"expected model update event; events: {events:?}"
);
@@ -320,7 +320,7 @@ async fn reasoning_selection_in_plan_mode_without_effort_change_does_not_open_sc
#[tokio::test]
async fn reasoning_selection_in_plan_mode_matching_plan_effort_but_different_global_opens_scope_prompt()
{
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
@@ -334,7 +334,7 @@ async fn reasoning_selection_in_plan_mode_matching_plan_effort_but_different_glo
// should open the scope prompt rather than silently rewriting the global default.
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
let preset = get_available_model(&chat, "gpt-5.4");
let preset = get_available_model(&chat, "gpt-5.5");
chat.open_reasoning_popup(preset);
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
@@ -344,13 +344,13 @@ async fn reasoning_selection_in_plan_mode_matching_plan_effort_but_different_glo
AppEvent::OpenPlanReasoningScopePrompt {
model,
effort: Some(ReasoningEffortConfig::Medium)
} if model == "gpt-5.4"
} if model == "gpt-5.5"
);
}
#[tokio::test]
async fn reasoning_shortcut_in_plan_mode_updates_plan_override_without_prompt_or_persist() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
@@ -398,7 +398,7 @@ async fn reasoning_shortcut_in_plan_mode_updates_plan_override_without_prompt_or
#[tokio::test]
async fn advanced_reasoning_selection_in_plan_mode_uses_expected_scope() {
for effort in [ReasoningEffortConfig::Ultra, ReasoningEffortConfig::Max] {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
@@ -406,7 +406,7 @@ async fn advanced_reasoning_selection_in_plan_mode_uses_expected_scope() {
chat.set_collaboration_mask(plan_mask);
let _ = drain_insert_history(&mut rx);
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.supported_reasoning_efforts = vec![ReasoningEffortPreset {
effort: effort.clone(),
description: "Advanced reasoning".to_string(),
@@ -421,7 +421,7 @@ async fn advanced_reasoning_selection_in_plan_mode_uses_expected_scope() {
AppEvent::ApplyAdvancedReasoning {
model,
effort: ReasoningEffortConfig::Ultra,
} if model == "gpt-5.4"
} if model == "gpt-5.5"
)));
assert!(events.iter().all(|event| !matches!(
event,
@@ -435,7 +435,7 @@ async fn advanced_reasoning_selection_in_plan_mode_uses_expected_scope() {
AppEvent::OpenPlanReasoningScopePrompt {
model,
effort: Some(ReasoningEffortConfig::Max),
} if model == "gpt-5.4"
} if model == "gpt-5.5"
)));
}
}
@@ -443,7 +443,7 @@ async fn advanced_reasoning_selection_in_plan_mode_uses_expected_scope() {
#[tokio::test]
async fn plan_mode_reasoning_override_is_marked_current_in_reasoning_popup() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
set_chatgpt_auth(&mut chat);
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
@@ -453,7 +453,7 @@ async fn plan_mode_reasoning_override_is_marked_current_in_reasoning_popup() {
.expect("expected plan collaboration mode");
chat.set_collaboration_mask(plan_mask);
let preset = get_available_model(&chat, "gpt-5.4");
let preset = get_available_model(&chat, "gpt-5.5");
chat.open_reasoning_popup(preset);
let popup = render_bottom_popup(&chat, /*width*/ 100);
@@ -466,7 +466,7 @@ async fn plan_mode_reasoning_override_is_marked_current_in_reasoning_popup() {
#[tokio::test]
async fn reasoning_selection_in_plan_mode_model_switch_does_not_open_scope_prompt_event() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
@@ -475,7 +475,7 @@ async fn reasoning_selection_in_plan_mode_model_switch_does_not_open_scope_promp
let _ = drain_insert_history(&mut rx);
set_chatgpt_auth(&mut chat);
let preset = get_available_model(&chat, "gpt-5.2");
let preset = get_available_model(&chat, "gpt-5.6-terra");
chat.open_reasoning_popup(preset);
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
@@ -483,7 +483,7 @@ async fn reasoning_selection_in_plan_mode_model_switch_does_not_open_scope_promp
assert!(
events.iter().any(|event| matches!(
event,
AppEvent::UpdateModel(model) if model == "gpt-5.2"
AppEvent::UpdateModel(model) if model == "gpt-5.6-terra"
)),
"expected model update event; events: {events:?}"
);
@@ -497,8 +497,8 @@ async fn reasoning_selection_in_plan_mode_model_switch_does_not_open_scope_promp
#[tokio::test]
async fn plan_reasoning_scope_popup_all_modes_persists_global_and_plan_override() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
chat.open_plan_reasoning_scope_prompt("gpt-5.4".to_string(), Some(ReasoningEffortConfig::High));
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.open_plan_reasoning_scope_prompt("gpt-5.5".to_string(), Some(ReasoningEffortConfig::High));
chat.handle_key_event(KeyEvent::from(KeyCode::Down));
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
@@ -522,7 +522,7 @@ async fn plan_reasoning_scope_popup_all_modes_persists_global_and_plan_override(
events.iter().any(|event| matches!(
event,
AppEvent::PersistModelSelection { model, effort: Some(ReasoningEffortConfig::High) }
if model == "gpt-5.4"
if model == "gpt-5.5"
)),
"expected global model reasoning selection persistence; events: {events:?}"
);
@@ -548,7 +548,7 @@ fn plan_mode_prompt_notification_uses_dedicated_type_name() {
#[tokio::test]
async fn open_plan_implementation_prompt_sets_pending_notification() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.local_settings.tui.notification_settings.notifications =
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
@@ -562,11 +562,11 @@ async fn open_plan_implementation_prompt_sets_pending_notification() {
#[tokio::test]
async fn open_plan_reasoning_scope_prompt_sets_pending_notification() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.local_settings.tui.notification_settings.notifications =
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
chat.open_plan_reasoning_scope_prompt("gpt-5.4".to_string(), Some(ReasoningEffortConfig::High));
chat.open_plan_reasoning_scope_prompt("gpt-5.5".to_string(), Some(ReasoningEffortConfig::High));
assert_matches!(
chat.pending_notification,
@@ -576,7 +576,7 @@ async fn open_plan_reasoning_scope_prompt_sets_pending_notification() {
#[tokio::test]
async fn agent_turn_complete_does_not_override_pending_plan_mode_prompt_notification() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.open_plan_implementation_prompt();
chat.notify(Notification::AgentTurnComplete {
@@ -591,7 +591,7 @@ async fn agent_turn_complete_does_not_override_pending_plan_mode_prompt_notifica
#[tokio::test]
async fn request_user_input_notification_overrides_pending_agent_turn_complete_notification() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.notify(Notification::AgentTurnComplete {
response: "done".to_string(),
@@ -623,7 +623,7 @@ async fn request_user_input_notification_overrides_pending_agent_turn_complete_n
#[tokio::test]
async fn handle_request_user_input_sets_pending_notification() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.local_settings.tui.notification_settings.notifications =
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
@@ -654,10 +654,10 @@ async fn handle_request_user_input_sets_pending_notification() {
#[tokio::test]
async fn plan_reasoning_scope_popup_mentions_selected_reasoning() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.set_plan_mode_reasoning_effort(Some(ReasoningEffortConfig::Low));
chat.open_plan_reasoning_scope_prompt(
"gpt-5.4".to_string(),
"gpt-5.5".to_string(),
Some(ReasoningEffortConfig::Medium),
);
@@ -671,9 +671,9 @@ async fn plan_reasoning_scope_popup_mentions_selected_reasoning() {
#[tokio::test]
async fn plan_reasoning_scope_popup_mentions_built_in_plan_default_when_no_override() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.open_plan_reasoning_scope_prompt(
"gpt-5.4".to_string(),
"gpt-5.5".to_string(),
Some(ReasoningEffortConfig::Medium),
);
@@ -683,8 +683,8 @@ async fn plan_reasoning_scope_popup_mentions_built_in_plan_default_when_no_overr
#[tokio::test]
async fn plan_reasoning_scope_popup_plan_only_does_not_update_all_modes_reasoning() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
chat.open_plan_reasoning_scope_prompt("gpt-5.4".to_string(), Some(ReasoningEffortConfig::High));
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.open_plan_reasoning_scope_prompt("gpt-5.5".to_string(), Some(ReasoningEffortConfig::High));
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
@@ -1365,7 +1365,7 @@ async fn mode_switch_surfaces_model_change_notification_when_effective_model_cha
let mut plan_mask =
collaboration_modes::mask_for_kind(chat.model_catalog.as_ref(), ModeKind::Plan)
.expect("expected plan collaboration mode");
plan_mask.model = Some("gpt-5.4-mini".to_string());
plan_mask.model = Some("gpt-5.6-luna".to_string());
chat.set_collaboration_mask(plan_mask);
let plan_messages = drain_insert_history(&mut rx)
@@ -1374,7 +1374,7 @@ async fn mode_switch_surfaces_model_change_notification_when_effective_model_cha
.collect::<Vec<_>>()
.join("\n");
assert!(
plan_messages.contains("Model changed to gpt-5.4-mini medium for Plan mode."),
plan_messages.contains("Model changed to gpt-5.6-luna medium for Plan mode."),
"expected Plan-mode model switch notice, got: {plan_messages:?}"
);
@@ -1397,7 +1397,7 @@ async fn mode_switch_surfaces_model_change_notification_when_effective_model_cha
#[tokio::test]
async fn mode_switch_surfaces_reasoning_change_notification_when_model_stays_same() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.6-terra")).await;
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
@@ -1411,7 +1411,7 @@ async fn mode_switch_surfaces_reasoning_change_notification_when_model_stays_sam
.collect::<Vec<_>>()
.join("\n");
assert!(
plan_messages.contains("Model changed to gpt-5.2 medium for Plan mode."),
plan_messages.contains("Model changed to gpt-5.6-terra medium for Plan mode."),
"expected reasoning-change notice in Plan mode, got: {plan_messages:?}"
);
}
@@ -1657,21 +1657,21 @@ async fn make_startup_chat_with_cli_overrides(
#[tokio::test]
async fn set_model_updates_active_collaboration_mask() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.6-terra")).await;
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::mask_for_kind(chat.model_catalog.as_ref(), ModeKind::Plan)
.expect("expected plan collaboration mask");
chat.set_collaboration_mask(plan_mask);
chat.set_model("gpt-5.4-mini");
chat.set_model("gpt-5.6-luna");
assert_eq!(chat.current_model(), "gpt-5.4-mini");
assert_eq!(chat.current_model(), "gpt-5.6-luna");
assert_eq!(chat.active_collaboration_mode_kind(), ModeKind::Plan);
}
#[tokio::test]
async fn set_reasoning_effort_updates_active_collaboration_mask() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.6-terra")).await;
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
let plan_mask = collaboration_modes::mask_for_kind(chat.model_catalog.as_ref(), ModeKind::Plan)
.expect("expected plan collaboration mask");
@@ -1688,7 +1688,7 @@ async fn set_reasoning_effort_updates_active_collaboration_mask() {
#[tokio::test]
async fn set_reasoning_effort_does_not_override_active_plan_override() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.6-terra")).await;
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
chat.set_plan_mode_reasoning_effort(Some(ReasoningEffortConfig::High));
let plan_mask = collaboration_modes::mask_for_kind(chat.model_catalog.as_ref(), ModeKind::Plan)
@@ -1758,10 +1758,10 @@ async fn collab_mode_applies_default_preset() {
#[tokio::test]
async fn user_turn_includes_personality_from_config() {
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.set_feature_enabled(Feature::Personality, /*enabled*/ true);
chat.thread_id = Some(ThreadId::new());
chat.set_model("gpt-5.4");
chat.set_model("gpt-5.5");
chat.set_personality(Personality::Friendly);
chat.bottom_pane
@@ -3302,7 +3302,7 @@ async fn memories_reset_confirmation_sends_event_on_confirm() {
#[tokio::test]
async fn model_selection_popup_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.open_model_popup();
@@ -3317,7 +3317,7 @@ fn apply_model_list_response(chat: &mut ChatWidget, presets: Vec<ModelPreset>) {
#[tokio::test]
async fn model_picker_refresh_rejects_obsolete_and_unusable_replies() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let initial = chat.model_catalog.try_list_models().unwrap();
let mut refreshed = initial.clone();
@@ -3362,9 +3362,9 @@ async fn model_picker_refresh_rejects_obsolete_and_unusable_replies() {
#[tokio::test]
async fn model_picker_refreshes_startup_catalog() {
for (explicit_all_models, hidden_startup) in [(false, false), (true, false), (false, true)] {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let mut startup = vec![get_available_model(&chat, "gpt-5.2")];
let mut startup = vec![get_available_model(&chat, "gpt-5.5")];
let mut refreshed = chat.model_catalog.try_list_models().unwrap();
let mut auto = startup[0].clone();
auto.model = "codex-auto-test".to_string();
@@ -3405,10 +3405,10 @@ async fn model_picker_refreshes_startup_catalog() {
#[tokio::test]
async fn model_picker_queued_all_models_uses_refreshed_catalog() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let refreshed = chat.model_catalog.try_list_models().unwrap();
let preset = get_available_model(&chat, "gpt-5.2");
let preset = get_available_model(&chat, "gpt-5.5");
let mut auto = preset.clone();
auto.model = "codex-auto-test".to_string();
auto.id = auto.model.clone();
@@ -3430,16 +3430,16 @@ async fn model_picker_queued_all_models_uses_refreshed_catalog() {
#[tokio::test]
async fn model_picker_refresh_preserves_highlight() {
for (remove_selected, reasoning_submenu, expected) in [
(false, false, "gpt-5.5"),
(true, false, "gpt-5.2"),
(false, true, "gpt-5.5"),
(true, true, "gpt-5.2"),
(false, false, "gpt-5.6-terra"),
(true, false, "gpt-5.5"),
(false, true, "gpt-5.6-terra"),
(true, true, "gpt-5.5"),
] {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let mut presets = vec![
get_available_model(&chat, "gpt-5.2"),
get_available_model(&chat, "gpt-5.5"),
get_available_model(&chat, "gpt-5.6-terra"),
];
chat.model_catalog = Arc::new(ModelCatalog::new(presets.clone()));
chat.open_model_popup();
@@ -3506,9 +3506,9 @@ async fn model_picker_refresh_preserves_dismissal_and_reasoning_submenu() {
(false, false, true),
(false, true, true),
] {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let preset = get_available_model(&chat, "gpt-5.2");
let preset = get_available_model(&chat, "gpt-5.5");
let refreshed = chat.model_catalog.try_list_models().unwrap();
chat.model_catalog = Arc::new(ModelCatalog::new(vec![preset.clone()]));
chat.open_model_popup();
@@ -3556,9 +3556,9 @@ async fn model_picker_refresh_dismisses_empty_choices() {
for (explicit_all_models, reasoning_submenu) in
[(false, false), (true, false), (false, true), (true, true)]
{
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let mut preset = get_available_model(&chat, "gpt-5.2");
let mut preset = get_available_model(&chat, "gpt-5.5");
chat.open_model_popup();
if explicit_all_models {
chat.handle_key_event(KeyEvent::from(KeyCode::Esc));
@@ -3592,7 +3592,7 @@ async fn model_picker_refresh_dismisses_empty_choices() {
#[tokio::test]
async fn personality_selection_popup_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.open_personality_popup();
@@ -3687,12 +3687,12 @@ async fn server_overloaded_error_does_not_switch_models() {
#[tokio::test]
async fn model_reasoning_selection_popup_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
set_chatgpt_auth(&mut chat);
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.supported_reasoning_efforts.insert(
2,
ReasoningEffortPreset {
@@ -3720,10 +3720,10 @@ async fn model_reasoning_selection_popup_snapshot() {
#[tokio::test]
async fn model_advanced_reasoning_selection_popup_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.set_reasoning_effort(Some(ReasoningEffortConfig::Ultra));
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.supported_reasoning_efforts.extend([
ReasoningEffortPreset {
effort: ReasoningEffortConfig::Ultra,
@@ -3742,11 +3742,11 @@ async fn model_advanced_reasoning_selection_popup_snapshot() {
#[tokio::test]
async fn model_reasoning_selection_popup_applies_custom_effort() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
let custom_effort = ReasoningEffortConfig::Custom("future".to_string());
chat.set_reasoning_effort(Some(ReasoningEffortConfig::XHigh));
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset
.supported_reasoning_efforts
.push(ReasoningEffortPreset {
@@ -3770,19 +3770,19 @@ async fn model_reasoning_selection_popup_applies_custom_effort() {
selected_effort_events,
vec![
(None, Some(custom_effort.clone())),
(Some("gpt-5.4".to_string()), Some(custom_effort)),
(Some("gpt-5.5".to_string()), Some(custom_effort)),
]
);
}
async fn select_ultra_with_multi_agent_thread_limit(max_threads: usize) -> (bool, Vec<String>) {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.config
.multi_agent_v2
.max_concurrent_threads_per_session = max_threads;
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.default_reasoning_effort = ReasoningEffortConfig::High;
preset.supported_reasoning_efforts = vec![
ReasoningEffortPreset {
@@ -3849,10 +3849,10 @@ async fn ultra_reasoning_selection_skips_warning_below_threshold() {
#[tokio::test]
async fn max_reasoning_selection_persists_model_selection() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.supported_reasoning_efforts = vec![ReasoningEffortPreset {
effort: ReasoningEffortConfig::Max,
description: "Maximum reasoning".to_string(),
@@ -3870,7 +3870,7 @@ async fn max_reasoning_selection_persists_model_selection() {
AppEvent::PersistModelSelection {
model,
effort: Some(ReasoningEffortConfig::Max),
} if model == "gpt-5.4"
} if model == "gpt-5.5"
)));
assert!(
events
@@ -3879,26 +3879,12 @@ async fn max_reasoning_selection_persists_model_selection() {
);
}
#[tokio::test]
async fn model_reasoning_selection_popup_extra_high_warning_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
set_chatgpt_auth(&mut chat);
chat.set_reasoning_effort(Some(ReasoningEffortConfig::XHigh));
let preset = get_available_model(&chat, "gpt-5.2");
chat.open_reasoning_popup(preset);
let popup = render_bottom_popup(&chat, /*width*/ 80);
assert_chatwidget_snapshot!("model_reasoning_selection_popup_extra_high_warning", popup);
}
async fn assert_reasoning_shortcuts_update_effort(
key_events: [KeyEvent; 2],
expected_effort: ReasoningEffortConfig,
) {
for key_event in key_events {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_reasoning_effort(Some(ReasoningEffortConfig::Medium));
@@ -3953,7 +3939,7 @@ async fn reasoning_down_shortcuts_lower_reasoning_effort() {
#[tokio::test]
async fn reasoning_shortcut_clears_armed_quit_shortcut() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_reasoning_effort(Some(ReasoningEffortConfig::Medium));
chat.arm_quit_shortcut(key_hint::ctrl(KeyCode::Char('c')));
@@ -3974,7 +3960,7 @@ async fn reasoning_shortcut_clears_armed_quit_shortcut() {
#[tokio::test]
async fn reasoning_shortcut_is_ignored_with_model_popup_open() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.set_reasoning_effort(Some(ReasoningEffortConfig::Medium));
chat.open_model_popup();
@@ -3999,12 +3985,12 @@ async fn reasoning_shortcut_is_ignored_with_model_popup_open() {
#[tokio::test]
async fn reasoning_up_shortcut_does_not_silently_enter_advanced_effort() {
for (model, model_path) in [
("gpt-5.4", "All models → gpt-5.4"),
("gpt-5.5", "All models → gpt-5.5"),
("codex-auto-test", "codex-auto-test"),
] {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.id = model.to_string();
preset.model = model.to_string();
preset.display_name = model.to_string();
@@ -4051,9 +4037,9 @@ async fn reasoning_up_shortcut_does_not_silently_enter_advanced_effort() {
#[tokio::test]
async fn reasoning_down_shortcut_can_leave_advanced_effort() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.supported_reasoning_efforts.extend([
ReasoningEffortPreset {
effort: ReasoningEffortConfig::Ultra,
@@ -4088,11 +4074,11 @@ async fn reasoning_down_shortcut_can_leave_advanced_effort() {
#[tokio::test]
async fn reasoning_popup_shows_extra_high_with_space() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
set_chatgpt_auth(&mut chat);
let preset = get_available_model(&chat, "gpt-5.4");
let preset = get_available_model(&chat, "gpt-5.5");
chat.open_reasoning_popup(preset);
let popup = render_bottom_popup(&chat, /*width*/ 120);
@@ -4158,7 +4144,7 @@ async fn single_reasoning_option_skips_selection() {
#[tokio::test]
async fn advanced_only_reasoning_option_requires_explicit_selection() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
let mut preset = get_available_model(&chat, "gpt-5.4");
let mut preset = get_available_model(&chat, "gpt-5.5");
preset.default_reasoning_effort = ReasoningEffortConfig::Ultra;
preset.supported_reasoning_efforts = vec![ReasoningEffortPreset {
effort: ReasoningEffortConfig::Ultra,
@@ -4264,11 +4250,11 @@ async fn feedback_good_result_consent_popup_includes_connectivity_diagnostics_fi
#[tokio::test]
async fn reasoning_popup_escape_returns_to_model_popup() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.thread_id = Some(ThreadId::new());
chat.open_model_popup();
let preset = get_available_model(&chat, "gpt-5.4");
let preset = get_available_model(&chat, "gpt-5.5");
chat.open_reasoning_popup(preset);
let before_escape = render_bottom_popup(&chat, /*width*/ 80);
@@ -122,8 +122,8 @@ fn next_copy_selection(
#[tokio::test]
async fn service_tier_commands_lowercase_catalog_names() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let mut preset = get_available_model(&chat, "gpt-5.4");
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
let mut preset = get_available_model(&chat, "gpt-5.5");
let expected_description = preset
.service_tiers
.iter()
@@ -2068,7 +2068,7 @@ async fn slash_copy_picker_previews_whole_response_code_blocks_and_blockquotes()
#[tokio::test]
async fn slash_copy_picker_copies_status_fields_and_preserves_source_after_copying() {
let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
let session_id = "00000000-0000-0000-0000-000000000123";
chat.thread_id = Some(ThreadId::from_string(session_id).expect("valid thread ID"));
chat.thread_name = Some("Clipboard example".to_string());
@@ -2098,7 +2098,7 @@ async fn slash_copy_picker_copies_status_fields_and_preserves_source_after_copyi
);
let expected = [
("Whole status", whole_status.as_str()),
("Model", "gpt-5.4"),
("Model", "gpt-5.5"),
("Directory", directory.as_str()),
("Thread name", "Clipboard example"),
("Session ID", session_id),
@@ -90,7 +90,7 @@ async fn status_command_renders_immediately_without_rate_limit_refresh() {
#[tokio::test]
async fn status_command_uses_catalog_default_reasoning_when_config_empty() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
chat.config.model_reasoning_effort = None;
chat.dispatch_command(SlashCommand::Status);
@@ -102,7 +102,7 @@ async fn status_command_uses_catalog_default_reasoning_when_config_empty() {
other => panic!("expected status output, got {other:?}"),
};
assert!(
rendered.contains("gpt-5.4 (reasoning medium, summaries auto)"),
rendered.contains("gpt-5.5 (reasoning medium, summaries auto)"),
"expected /status to render the catalog default reasoning effort, got: {rendered}"
);
}