mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
[codex] Treat max as a first-class reasoning effort (#30467)
## Why The Bedrock GPT-5.6 catalog advertises `max`, but Codex treated it as an opaque custom effort. That made the reasoning picker render it as lowercase `max` while known efforts use productized labels. Making `max` a known effort aligns catalog data, parsing, and UI presentation without changing the `max` wire value or persisted representation. ## What changed - Add first-class `ReasoningEffort::Max` parsing and serialization. - Use the typed effort in the Bedrock catalog and render it as `Max` in the TUI. - Preserve forward-compatible custom-effort coverage with a genuinely unknown `future` value. ### Before <img width="559" height="124" alt="Screenshot 2026-06-28 at 12 08 47 PM" src="https://github.com/user-attachments/assets/7c43cf4f-020b-4605-9239-0a9c97eb7364" /> ### After <img width="558" height="107" alt="Screenshot 2026-06-28 at 12 09 10 PM" src="https://github.com/user-attachments/assets/b9cc5ded-c940-43b4-b024-bba25abe0a17" />
This commit is contained in:
@@ -505,6 +505,7 @@ impl ChatWidget {
|
||||
ReasoningEffortConfig::Medium => "Medium".to_string(),
|
||||
ReasoningEffortConfig::High => "High".to_string(),
|
||||
ReasoningEffortConfig::XHigh => "Extra high".to_string(),
|
||||
ReasoningEffortConfig::Max => "Max".to_string(),
|
||||
ReasoningEffortConfig::Ultra => "Ultra".to_string(),
|
||||
ReasoningEffortConfig::Custom(value) => value.clone(),
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn next_reasoning_effort_uses_advertised_order_for_custom_levels() {
|
||||
let custom_effort = ReasoningEffortConfig::Custom("max".to_string());
|
||||
let custom_effort = ReasoningEffortConfig::Custom("future".to_string());
|
||||
let choices = vec![
|
||||
ReasoningEffortConfig::High,
|
||||
ReasoningEffortConfig::Low,
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ expression: popup
|
||||
|
||||
1. Low Fast responses with lighter reasoning
|
||||
2. Medium (default) Balances speed and reasoning depth for everyday tasks
|
||||
3. max Maximum available reasoning
|
||||
3. Max Maximum available reasoning
|
||||
› 4. High (current) Greater reasoning depth for complex problems
|
||||
5. Extra high Extra high reasoning depth for complex problems
|
||||
|
||||
|
||||
@@ -3191,7 +3191,7 @@ async fn model_reasoning_selection_popup_snapshot() {
|
||||
preset.supported_reasoning_efforts.insert(
|
||||
2,
|
||||
ReasoningEffortPreset {
|
||||
effort: ReasoningEffortConfig::Custom("max".to_string()),
|
||||
effort: ReasoningEffortConfig::Max,
|
||||
description: "Maximum available reasoning".to_string(),
|
||||
},
|
||||
);
|
||||
@@ -3204,7 +3204,7 @@ async fn model_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 custom_effort = ReasoningEffortConfig::Custom("max".to_string());
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user