fix: stop mapping Astra Off to reasoning.effort none (#11976)
This commit is contained in:
@@ -1929,7 +1929,6 @@ pub(crate) fn openai_reasoning_efforts_for_model(model_name: &str) -> &'static [
|
||||
|| normalized.contains("gpt-5-5")
|
||||
|| normalized.contains("gpt-5.6")
|
||||
|| normalized.contains("gpt-5-6")
|
||||
|| normalized.contains("gpt-6")
|
||||
{
|
||||
&["none", "low", "medium", "high", "xhigh"]
|
||||
} else {
|
||||
@@ -3286,6 +3285,43 @@ mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_openai_reasoning_effort_gpt6_does_not_support_none() {
|
||||
for model in [
|
||||
"gpt-6-astra",
|
||||
"data_workflow_tools.goose.goose-gpt-6-astra",
|
||||
"openrouter/openai/gpt-6-astra",
|
||||
] {
|
||||
assert_eq!(
|
||||
openai_reasoning_effort_for_thinking(model, ThinkingEffort::Off),
|
||||
Some("low".to_string()),
|
||||
"{model} Off should map to low, not none"
|
||||
);
|
||||
assert_eq!(
|
||||
openai_reasoning_effort_for_thinking(model, ThinkingEffort::Medium),
|
||||
Some("medium".to_string()),
|
||||
"{model} medium should remain medium"
|
||||
);
|
||||
assert!(
|
||||
!openai_reasoning_efforts_for_model(model).contains(&"none"),
|
||||
"{model} must not advertise none"
|
||||
);
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
openai_reasoning_effort_for_thinking("gpt-5.6-luna", ThinkingEffort::Off),
|
||||
Some("none".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
openai_reasoning_effort_for_thinking("gpt-5.4", ThinkingEffort::Off),
|
||||
Some("none".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
openai_reasoning_effort_for_thinking("gpt-5", ThinkingEffort::Off),
|
||||
Some("low".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_request_gpt5_pro_max_effort_uses_supported_level() -> anyhow::Result<()> {
|
||||
let model_config = test_model_config("gpt-5.2-pro-2025-12-11")
|
||||
|
||||
@@ -2040,6 +2040,28 @@ mod tests {
|
||||
assert_eq!(result["reasoning"]["summary"], "auto");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_responses_request_gpt6_astra_off_uses_low_not_none() {
|
||||
for model_name in ["gpt-6-astra", "data_workflow_tools.goose.goose-gpt-6-astra"] {
|
||||
let model_config = ModelConfig::new(model_name)
|
||||
.with_thinking_effort(crate::thinking::ThinkingEffort::Off);
|
||||
|
||||
let result =
|
||||
create_responses_request(&model_config, "You are helpful.", &[], &[]).unwrap();
|
||||
|
||||
assert_eq!(result["model"], model_name, "{model_name}");
|
||||
assert_eq!(
|
||||
result["reasoning"]["effort"], "low",
|
||||
"{model_name} Off should serialize as low, not none"
|
||||
);
|
||||
}
|
||||
|
||||
let model_config = ModelConfig::new("gpt-5.6-luna")
|
||||
.with_thinking_effort(crate::thinking::ThinkingEffort::Off);
|
||||
let result = create_responses_request(&model_config, "You are helpful.", &[], &[]).unwrap();
|
||||
assert_eq!(result["reasoning"]["effort"], "none");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_responses_request_supports_gpt_5_6_reasoning_mode() {
|
||||
for model_name in [
|
||||
|
||||
Reference in New Issue
Block a user