support Opus 5.5, GPT-6-{sol,luna} (#12447)

This commit is contained in:
Jack Amadeo
2026-09-22 19:44:21 +00:00
committed by GitHub
parent c815645841
commit 9fd1051bb0
6 changed files with 3698 additions and 266 deletions
@@ -279,6 +279,33 @@ mod tests {
assert!(canonical.cost.output.is_some());
}
#[test]
fn anthropic_opus_5_5_resolves_with_always_on_adaptive_thinking() {
let canonical = maybe_get_canonical_model("anthropic", "claude-opus-5-5")
.expect("claude-opus-5-5 should resolve");
assert_eq!(canonical.id, "anthropic/claude-opus-5.5");
assert_eq!(canonical.limit.context, 1_000_000);
assert_eq!(canonical.limit.output, Some(128_000));
assert_eq!(
canonical.thinking_mode,
Some(ThinkingMode::AlwaysOnAdaptive)
);
assert_eq!(canonical.cost.input, Some(4.0));
assert_eq!(canonical.cost.output, Some(20.0));
}
#[test]
fn openai_gpt_6_sol_and_luna_resolve() {
for (model, input_cost) in [("gpt-6-sol", 2.0), ("gpt-6-luna", 0.1)] {
let canonical = maybe_get_canonical_model("openai", model)
.unwrap_or_else(|| panic!("{model} should resolve"));
assert_eq!(canonical.limit.context, 1_050_000);
assert_eq!(canonical.limit.output, Some(128_000));
assert_eq!(canonical.cost.input, Some(input_cost));
assert!(canonical.tool_call);
}
}
#[test]
fn kimi_code_k3_resolves_with_reasoning_and_context_limit() {
let canonical = maybe_get_canonical_model("kimi_code", "k3")
File diff suppressed because it is too large Load Diff
@@ -427,7 +427,7 @@
"env": [
"CROSSMODEL_API_KEY"
],
"model_count": 60
"model_count": 63
},
{
"id": "crusoe",
@@ -538,7 +538,7 @@
"env": [
"EDENAI_API_KEY"
],
"model_count": 279
"model_count": 280
},
{
"id": "empiriolabs",
@@ -549,7 +549,7 @@
"env": [
"EMPIRIOLABS_API_KEY"
],
"model_count": 65
"model_count": 66
},
{
"id": "evroc",
@@ -869,7 +869,7 @@
"env": [
"KILO_API_KEY"
],
"model_count": 381
"model_count": 387
},
{
"id": "kimi-code-plan-cn",
@@ -946,7 +946,7 @@
"env": [
"LLMGATEWAY_API_KEY"
],
"model_count": 194
"model_count": 202
},
{
"id": "llmgateway-providers",
@@ -957,7 +957,7 @@
"env": [
"LLMGATEWAY_API_KEY"
],
"model_count": 406
"model_count": 423
},
{
"id": "llmtech",
@@ -1232,7 +1232,7 @@
"env": [
"NANO_GPT_API_KEY"
],
"model_count": 577
"model_count": 581
},
{
"id": "nearai",
@@ -1343,7 +1343,7 @@
"env": [
"OFOX_API_KEY"
],
"model_count": 144
"model_count": 145
},
{
"id": "ollama-cloud",
@@ -1365,7 +1365,7 @@
"env": [
"OPENCODE_API_KEY"
],
"model_count": 105
"model_count": 108
},
{
"id": "opencode-go",
@@ -1531,7 +1531,7 @@
"env": [
"REQUESTY_API_KEY"
],
"model_count": 153
"model_count": 155
},
{
"id": "routing-run",
@@ -1752,7 +1752,7 @@
"env": [
"TEMPR_API_KEY"
],
"model_count": 14
"model_count": 29
},
{
"id": "tencent-coding-plan",
@@ -2005,7 +2005,7 @@
"env": [
"WANDB_API_KEY"
],
"model_count": 27
"model_count": 29
},
{
"id": "xiaomi",
@@ -2016,7 +2016,7 @@
"env": [
"XIAOMI_API_KEY"
],
"model_count": 6
"model_count": 9
},
{
"id": "xiaomi-token-plan-ams",
@@ -2027,7 +2027,7 @@
"env": [
"XIAOMI_API_KEY"
],
"model_count": 7
"model_count": 9
},
{
"id": "xiaomi-token-plan-cn",
@@ -2038,7 +2038,7 @@
"env": [
"XIAOMI_API_KEY"
],
"model_count": 7
"model_count": 9
},
{
"id": "xiaomi-token-plan-sgp",
@@ -2049,7 +2049,7 @@
"env": [
"XIAOMI_API_KEY"
],
"model_count": 7
"model_count": 9
},
{
"id": "xpersona",
@@ -2384,6 +2384,20 @@ mod tests {
);
}
#[test]
fn test_thinking_type_opus_5_5_cannot_disable_thinking() {
let _guard = env_lock::lock_env([("GOOSE_THINKING_EFFORT", None::<&str>)]);
assert_eq!(
thinking_type(&cfg("claude-opus-5-5")),
ThinkingType::Adaptive
);
assert_eq!(
thinking_type(&cfg_with_effort("claude-opus-5-5", "off")),
ThinkingType::Adaptive
);
}
#[test]
fn test_create_request_fable_5_omits_temperature() -> Result<()> {
let _guard = env_lock::lock_env([("GOOSE_THINKING_EFFORT", None::<&str>)]);
@@ -1909,7 +1909,7 @@ pub fn openai_reasoning_effort_for_thinking(
ThinkingEffort::Low => &["low", "medium", "high", "xhigh"],
ThinkingEffort::Medium => &["medium", "high", "low", "xhigh"],
ThinkingEffort::High => &["high", "medium", "xhigh", "low"],
ThinkingEffort::Max => &["xhigh", "high", "medium", "low"],
ThinkingEffort::Max => &["max", "xhigh", "high", "medium", "low"],
};
preferred
@@ -1924,6 +1924,13 @@ pub(crate) fn openai_reasoning_efforts_for_model(model_name: &str) -> &'static [
if normalized.contains("gpt-5") || normalized.contains("gpt-6") {
if normalized.contains("-pro") || normalized.contains("/pro") {
&["high"]
} else if normalized.contains("gpt-6") {
// GPT-6 Astra does not accept `none`; Sol and Luna do.
if normalized.contains("astra") {
&["low", "medium", "high", "xhigh", "max"]
} else {
&["none", "low", "medium", "high", "xhigh", "max"]
}
} else if normalized.contains("gpt-5.4")
|| normalized.contains("gpt-5-4")
|| normalized.contains("gpt-5.5")
@@ -3291,6 +3298,37 @@ mod tests {
Ok(())
}
#[test]
fn test_openai_reasoning_effort_gpt6_sol_and_luna() {
for model in ["gpt-6-sol", "gpt-6-luna"] {
assert_eq!(
openai_reasoning_effort_for_thinking(model, ThinkingEffort::Off),
Some("none".to_string())
);
assert_eq!(
openai_reasoning_effort_for_thinking(model, ThinkingEffort::Max),
Some("max".to_string())
);
assert_eq!(
openai_reasoning_efforts_for_model(model),
&["none", "low", "medium", "high", "xhigh", "max"]
);
assert!(
is_openai_responses_model(model),
"{model} uses /v1/responses"
);
}
assert_eq!(
openai_reasoning_effort_for_thinking("gpt-6-astra", ThinkingEffort::Max),
Some("max".to_string())
);
assert_eq!(
openai_reasoning_effort_for_thinking("gpt-5.6-sol", ThinkingEffort::Max),
Some("xhigh".to_string())
);
}
#[test]
fn test_openai_reasoning_effort_gpt6_does_not_support_none() {
for model in [
@@ -359,6 +359,7 @@ fn inferred_thinking_mode(canonical_id: &str) -> Option<ThinkingMode> {
"anthropic/claude-fable-5" => Some(ThinkingMode::AlwaysOnAdaptive),
"anthropic/claude-fable-5.1" => Some(ThinkingMode::AlwaysOnAdaptive),
"anthropic/claude-opus-5" => Some(ThinkingMode::Adaptive),
"anthropic/claude-opus-5.5" => Some(ThinkingMode::AlwaysOnAdaptive),
"anthropic/claude-opus-4.6" => Some(ThinkingMode::Adaptive),
"anthropic/claude-opus-4.7" => Some(ThinkingMode::Adaptive),
"anthropic/claude-opus-4.8" => Some(ThinkingMode::Adaptive),