From e4b5b454b6d381133df820b38e3747c65a250dfc Mon Sep 17 00:00:00 2001 From: Bradley Axen Date: Thu, 12 Nov 2026 22:03:08 +0000 Subject: [PATCH] fix(anthropic): use adaptive thinking for Claude Fable 5.2 (#13478) Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz> Co-authored-by: Lifei Zhou (cherry picked from commit 4a55150924f267baea73d3c2045874354aee69e1) --- .../src/canonical/data/canonical_models.json | 1 + .../src/canonical/models_dev.rs | 5 +++-- .../goose-provider-types/src/formats/anthropic.rs | 15 +++++++++++++++ .../src/formats/databricks.rs | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/goose-provider-types/src/canonical/data/canonical_models.json b/crates/goose-provider-types/src/canonical/data/canonical_models.json index 6171e8065..0640a5b9e 100644 --- a/crates/goose-provider-types/src/canonical/data/canonical_models.json +++ b/crates/goose-provider-types/src/canonical/data/canonical_models.json @@ -36227,6 +36227,7 @@ "xhigh", "max" ], + "thinking_mode": "always_on_adaptive", "tool_call": true, "temperature": false, "knowledge": "2026-06", diff --git a/crates/goose-provider-types/src/canonical/models_dev.rs b/crates/goose-provider-types/src/canonical/models_dev.rs index cfca50ee3..81ece8cce 100644 --- a/crates/goose-provider-types/src/canonical/models_dev.rs +++ b/crates/goose-provider-types/src/canonical/models_dev.rs @@ -30,9 +30,10 @@ fn get_thinking_mode(canonical_id: &str, value: &Value) -> Option } fn inferred_thinking_mode(canonical_id: &str) -> Option { + if canonical_id.starts_with("anthropic/claude-fable-") { + return Some(ThinkingMode::AlwaysOnAdaptive); + } match canonical_id { - "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), diff --git a/crates/goose-provider-types/src/formats/anthropic.rs b/crates/goose-provider-types/src/formats/anthropic.rs index 01600a3a8..0fb10ac3c 100644 --- a/crates/goose-provider-types/src/formats/anthropic.rs +++ b/crates/goose-provider-types/src/formats/anthropic.rs @@ -2451,6 +2451,21 @@ mod tests { ); } + #[test] + fn test_thinking_type_fable_5_2_is_always_on_adaptive() { + let _guard = env_lock::lock_env([("GOOSE_THINKING_EFFORT", None::<&str>)]); + + for model in ["claude-fable-5-2", "system.ai.claude-fable-5-2"] { + for effort in ["off", "low", "high"] { + assert_eq!( + thinking_type(&cfg_with_effort(model, effort)), + ThinkingType::Adaptive, + "{model} {effort}" + ); + } + } + } + #[test] fn test_thinking_type_opus_5_5_cannot_disable_thinking() { let _guard = env_lock::lock_env([("GOOSE_THINKING_EFFORT", None::<&str>)]); diff --git a/crates/goose-provider-types/src/formats/databricks.rs b/crates/goose-provider-types/src/formats/databricks.rs index e39b11989..7b2f86dc4 100644 --- a/crates/goose-provider-types/src/formats/databricks.rs +++ b/crates/goose-provider-types/src/formats/databricks.rs @@ -1552,6 +1552,8 @@ mod tests { "databricks-claude-opus-4-8", "databricks-claude-fable-5", "global.anthropic.claude-fable-5", + "databricks-claude-fable-5-2", + "system.ai.claude-fable-5-2", ] { let mut model_config = ModelConfig::new(name); model_config.max_tokens = Some(4096);