mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
fix(models): use new gpt-5.2-codex migration key
This commit is contained in:
@@ -9,6 +9,7 @@ pub const HIDE_GPT5_1_MIGRATION_PROMPT_CONFIG: &str = "hide_gpt5_1_migration_pro
|
||||
pub const HIDE_GPT_5_1_CODEX_MAX_MIGRATION_PROMPT_CONFIG: &str =
|
||||
"hide_gpt-5.1-codex-max_migration_prompt";
|
||||
pub const HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG: &str = "hide_gpt5_2_migration_prompt";
|
||||
pub const HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG: &str = "hide_gpt5_2_codex_migration_prompt";
|
||||
|
||||
/// A reasoning effort option surfaced for a model.
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -112,7 +113,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: true,
|
||||
},
|
||||
@@ -145,7 +146,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: true,
|
||||
},
|
||||
@@ -175,7 +176,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: false,
|
||||
},
|
||||
@@ -201,7 +202,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: true,
|
||||
},
|
||||
@@ -234,7 +235,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: false,
|
||||
},
|
||||
@@ -264,7 +265,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: false,
|
||||
},
|
||||
@@ -289,7 +290,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: false,
|
||||
},
|
||||
@@ -326,7 +327,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.2-codex".to_string(),
|
||||
reasoning_effort_mapping: None,
|
||||
migration_config_key: HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
migration_config_key: HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG.to_string(),
|
||||
}),
|
||||
show_in_picker: false,
|
||||
},
|
||||
|
||||
@@ -742,6 +742,7 @@ pub struct Notice {
|
||||
#[serde(rename = "hide_gpt-5.1-codex-max_migration_prompt")]
|
||||
pub hide_gpt_5_1_codex_max_migration_prompt: Option<bool>,
|
||||
pub hide_gpt5_2_migration_prompt: Option<bool>,
|
||||
pub hide_gpt5_2_codex_migration_prompt: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
||||
@@ -495,7 +495,7 @@ pub async fn run_main(
|
||||
};
|
||||
if let Some(plan) = determine_migration_plan(&config, auth_mode) {
|
||||
let should_auto_accept = matches!(auth_mode, AuthMode::ChatGPT)
|
||||
&& (plan.hide_key != code_common::model_presets::HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG
|
||||
&& (plan.hide_key != code_common::model_presets::HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG
|
||||
|| (plan.current.id.eq_ignore_ascii_case("gpt-5.1-codex")
|
||||
&& plan
|
||||
.target
|
||||
@@ -1141,6 +1141,8 @@ fn set_notice_flag(notices: &mut Notice, key: &str) {
|
||||
notices.hide_gpt_5_1_codex_max_migration_prompt = Some(true);
|
||||
} else if key == HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG {
|
||||
notices.hide_gpt5_2_migration_prompt = Some(true);
|
||||
} else if key == code_common::model_presets::HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG {
|
||||
notices.hide_gpt5_2_codex_migration_prompt = Some(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1151,6 +1153,8 @@ fn notice_hidden(notices: &Notice, key: &str) -> bool {
|
||||
notices.hide_gpt_5_1_codex_max_migration_prompt.unwrap_or(false)
|
||||
} else if key == HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG {
|
||||
notices.hide_gpt5_2_migration_prompt.unwrap_or(false)
|
||||
} else if key == code_common::model_presets::HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG {
|
||||
notices.hide_gpt5_2_codex_migration_prompt.unwrap_or(false)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
||||
@@ -33,6 +33,15 @@ pub(crate) fn migration_copy_for_key(key: &str) -> ModelMigrationCopy {
|
||||
can_opt_out: false,
|
||||
},
|
||||
code_common::model_presets::HIDE_GPT_5_2_MIGRATION_PROMPT_CONFIG => ModelMigrationCopy {
|
||||
heading: "Upgrade available: GPT-5.2",
|
||||
content: &[
|
||||
"OpenAI's latest frontier model is here! Improved knowledge, reasoning, and coding.",
|
||||
"Switch now to get better results; you can keep your current model if you prefer.",
|
||||
"Learn more: www.openai.com/index/gpt-5-2",
|
||||
],
|
||||
can_opt_out: true,
|
||||
},
|
||||
code_common::model_presets::HIDE_GPT_5_2_CODEX_MIGRATION_PROMPT_CONFIG => ModelMigrationCopy {
|
||||
heading: "Upgrade available: GPT-5.2 Codex",
|
||||
content: &[
|
||||
"OpenAI's latest frontier agentic coding model is here: gpt-5.2-codex.",
|
||||
|
||||
Reference in New Issue
Block a user