mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
tests
This commit is contained in:
@@ -56,6 +56,92 @@ const fn default_reasoning_effort_label(effort: ReasoningEffort) -> &'static str
|
||||
}
|
||||
}
|
||||
|
||||
const CODEX_AUTO_EFFORTS: &[ReasoningEffortPreset] = &[
|
||||
ReasoningEffortPreset::with_label(ReasoningEffort::Low, "Works faster", "Fast"),
|
||||
ReasoningEffortPreset::with_label(
|
||||
ReasoningEffort::Medium,
|
||||
"Balances speed with intelligence",
|
||||
"Balanced",
|
||||
),
|
||||
ReasoningEffortPreset::with_label(
|
||||
ReasoningEffort::High,
|
||||
"Works longer for harder tasks",
|
||||
"Thorough",
|
||||
),
|
||||
];
|
||||
|
||||
const GPT_51_CODEX_EFFORTS: &[ReasoningEffortPreset] = &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Fastest responses with limited reasoning",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Dynamically adjusts reasoning based on the task",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
];
|
||||
|
||||
const GPT_51_CODEX_MINI_EFFORTS: &[ReasoningEffortPreset] = &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Dynamically adjusts reasoning based on the task",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
];
|
||||
|
||||
const GPT_51_EFFORTS: &[ReasoningEffortPreset] = &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Balances speed with some reasoning; useful for straightforward queries and short explanations",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Provides a solid balance of reasoning depth and latency for general-purpose tasks",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
];
|
||||
|
||||
const GPT_5_EFFORTS: &[ReasoningEffortPreset] = &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Minimal,
|
||||
"Fastest responses with little reasoning",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Balances speed with some reasoning; useful for straightforward queries and short explanations",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Provides a solid balance of reasoning depth and latency for general-purpose tasks",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
];
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ModelUpgrade {
|
||||
pub id: &'static str,
|
||||
@@ -91,19 +177,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "codex-auto",
|
||||
description: "Automatically chooses the best Codex model configuration for your task.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::with_label(ReasoningEffort::Low, "Works faster", "Fast"),
|
||||
ReasoningEffortPreset::with_label(
|
||||
ReasoningEffort::Medium,
|
||||
"Balances speed with intelligence",
|
||||
"Balanced",
|
||||
),
|
||||
ReasoningEffortPreset::with_label(
|
||||
ReasoningEffort::High,
|
||||
"Works longer for harder tasks",
|
||||
"Thorough",
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: CODEX_AUTO_EFFORTS,
|
||||
is_default: true,
|
||||
upgrade: None,
|
||||
},
|
||||
@@ -113,23 +187,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "gpt-5.1-codex",
|
||||
description: "Optimized for codex.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Fastest responses with limited reasoning",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Dynamically adjusts reasoning based on the task",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: GPT_51_CODEX_EFFORTS,
|
||||
is_default: false,
|
||||
upgrade: None,
|
||||
},
|
||||
@@ -139,18 +197,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "gpt-5.1-codex-mini",
|
||||
description: "Optimized for codex. Cheaper, faster, but less capable.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Dynamically adjusts reasoning based on the task",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: GPT_51_CODEX_MINI_EFFORTS,
|
||||
is_default: false,
|
||||
upgrade: None,
|
||||
},
|
||||
@@ -160,23 +207,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "gpt-5.1",
|
||||
description: "Broad world knowledge with strong general reasoning.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Balances speed with some reasoning; useful for straightforward queries and short explanations",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Provides a solid balance of reasoning depth and latency for general-purpose tasks",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: GPT_51_EFFORTS,
|
||||
is_default: false,
|
||||
upgrade: None,
|
||||
},
|
||||
@@ -187,23 +218,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "gpt-5-codex",
|
||||
description: "Optimized for codex.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Fastest responses with limited reasoning",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Dynamically adjusts reasoning based on the task",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: GPT_51_CODEX_EFFORTS,
|
||||
is_default: false,
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.1-codex",
|
||||
@@ -216,18 +231,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "gpt-5-codex-mini",
|
||||
description: "Optimized for codex. Cheaper, faster, but less capable.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Dynamically adjusts reasoning based on the task",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: GPT_51_CODEX_MINI_EFFORTS,
|
||||
is_default: false,
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.1-codex-mini",
|
||||
@@ -240,28 +244,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
display_name: "gpt-5",
|
||||
description: "Broad world knowledge with strong general reasoning.",
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: &[
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Minimal,
|
||||
"Fastest responses with little reasoning",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Low,
|
||||
"Balances speed with some reasoning; useful for straightforward queries and short explanations",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::Medium,
|
||||
"Provides a solid balance of reasoning depth and latency for general-purpose tasks",
|
||||
None,
|
||||
),
|
||||
ReasoningEffortPreset::new(
|
||||
ReasoningEffort::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
),
|
||||
],
|
||||
supported_reasoning_efforts: GPT_5_EFFORTS,
|
||||
is_default: false,
|
||||
upgrade: Some(ModelUpgrade {
|
||||
id: "gpt-5.1",
|
||||
|
||||
@@ -1053,14 +1053,14 @@ mod tests {
|
||||
fn format_model_change_target_prefers_featured_label() {
|
||||
let formatted =
|
||||
super::format_model_change_target("codex-auto", Some(ReasoningEffortConfig::Low));
|
||||
assert_eq!(formatted, "codex-auto (Fast)");
|
||||
assert_eq!(formatted, "codex-auto (low)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_model_change_target_uses_effort_label() {
|
||||
let formatted =
|
||||
super::format_model_change_target("gpt-5.1-codex", Some(ReasoningEffortConfig::High));
|
||||
assert_eq!(formatted, "gpt-5.1-codex (Thorough)");
|
||||
assert_eq!(formatted, "gpt-5.1-codex (high)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -4,11 +4,11 @@ expression: popup
|
||||
---
|
||||
Select Reasoning Level for gpt-5.1-codex
|
||||
|
||||
1. Fast Fastest responses with limited reasoning
|
||||
2. Balanced (default) Dynamically adjusts reasoning based on the task
|
||||
› 3. Thorough (current) Maximizes reasoning depth for complex or ambiguous
|
||||
problems
|
||||
⚠ High reasoning effort can quickly consume Plus plan
|
||||
rate limits.
|
||||
1. Low Fastest responses with limited reasoning
|
||||
2. Medium (default) Dynamically adjusts reasoning based on the task
|
||||
› 3. High (current) Maximizes reasoning depth for complex or ambiguous
|
||||
problems
|
||||
⚠ High reasoning effort can quickly consume Plus plan
|
||||
rate limits.
|
||||
|
||||
Press enter to confirm or esc to go back
|
||||
|
||||
@@ -1573,17 +1573,19 @@ fn reasoning_popup_hides_default_label_when_option_is_current() {
|
||||
fn single_reasoning_option_skips_selection() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
|
||||
|
||||
const SINGLE_HIGH_REASONING: &[ReasoningEffortPreset] = &[ReasoningEffortPreset::new(
|
||||
ReasoningEffortConfig::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
)];
|
||||
|
||||
let preset = ModelPreset {
|
||||
id: "model-with-single-reasoning",
|
||||
model: "model-with-single-reasoning",
|
||||
display_name: "model-with-single-reasoning",
|
||||
description: "",
|
||||
default_reasoning_effort: ReasoningEffortConfig::High,
|
||||
supported_reasoning_efforts: &[ReasoningEffortPreset::new(
|
||||
ReasoningEffortConfig::High,
|
||||
"Maximizes reasoning depth for complex or ambiguous problems",
|
||||
None,
|
||||
)],
|
||||
supported_reasoning_efforts: SINGLE_HIGH_REASONING,
|
||||
is_default: false,
|
||||
upgrade: None,
|
||||
};
|
||||
|
||||
@@ -1818,7 +1818,7 @@ mod tests {
|
||||
.find(|line| line.contains("model:"))
|
||||
.expect("model line");
|
||||
|
||||
assert!(model_line.contains("gpt-4o Thorough"));
|
||||
assert!(model_line.contains("gpt-4o high"));
|
||||
assert!(model_line.contains("/model to change"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user