From 56505ac500ab77d4596d7c423ccfea9163a1cb4c Mon Sep 17 00:00:00 2001 From: Wolfe-Jam Date: Fri, 31 Jul 2026 18:24:03 -0400 Subject: [PATCH 1/3] fix(anthropic): add claude-sonnet-5 and claude-fable-5 to known models Resolves #10864 These models already exist in the bundled canonical registry but were missing from ANTHROPIC_KNOWN_MODELS, so the pre-key model picker could not show them. Mirror the Cursor known-list chore (#10618). Tests: unit coverage for list membership + ProviderMetadata surface. --- crates/goose-providers/src/anthropic.rs | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/crates/goose-providers/src/anthropic.rs b/crates/goose-providers/src/anthropic.rs index d505cadd296d..f7c5ecf446d5 100644 --- a/crates/goose-providers/src/anthropic.rs +++ b/crates/goose-providers/src/anthropic.rs @@ -30,6 +30,9 @@ pub const ANTHROPIC_DEFAULT_MODEL: &str = "claude-sonnet-4-5"; pub const ANTHROPIC_DEFAULT_FAST_MODEL: &str = "claude-haiku-4-5"; const ANTHROPIC_KNOWN_MODELS: &[&str] = &[ "claude-opus-5", + // Claude 5 family — pre-key picker (registry already has these; list was lagging) + "claude-sonnet-5", + "claude-fable-5", "claude-opus-4-8", "claude-opus-4-7", // Claude 4.6 models @@ -439,3 +442,54 @@ pub fn from_declarative_config( .skip_canonical_filtering(config.skip_canonical_filtering) .format_options(format_options)) } + +#[cfg(test)] +mod known_models_tests { + use super::*; + + #[test] + fn known_models_includes_claude_sonnet_5_and_fable_5() { + assert!( + ANTHROPIC_KNOWN_MODELS.contains(&"claude-sonnet-5"), + "claude-sonnet-5 must appear in the pre-key Anthropic model list" + ); + assert!( + ANTHROPIC_KNOWN_MODELS.contains(&"claude-fable-5"), + "claude-fable-5 must appear in the pre-key Anthropic model list" + ); + } + + #[test] + fn known_models_keep_opus_5_and_list_claude_5_newest_first() { + assert_eq!(ANTHROPIC_KNOWN_MODELS[0], "claude-opus-5"); + let sonnet = ANTHROPIC_KNOWN_MODELS + .iter() + .position(|&m| m == "claude-sonnet-5") + .expect("claude-sonnet-5 present"); + let fable = ANTHROPIC_KNOWN_MODELS + .iter() + .position(|&m| m == "claude-fable-5") + .expect("claude-fable-5 present"); + // Claude 5 entries should sit with opus-5 at the head, before 4.x legacy blocks + assert!(sonnet < 5, "claude-sonnet-5 should be near the top of the list"); + assert!(fable < 5, "claude-fable-5 should be near the top of the list"); + } + + #[test] + fn metadata_surfaces_claude_5_models_for_pre_key_picker() { + let meta = AnthropicProvider::metadata(); + let names: Vec<&str> = meta.known_models.iter().map(|m| m.name.as_str()).collect(); + assert!( + names.contains(&"claude-sonnet-5"), + "ProviderMetadata must expose claude-sonnet-5 before API key is set" + ); + assert!( + names.contains(&"claude-fable-5"), + "ProviderMetadata must expose claude-fable-5 before API key is set" + ); + assert!( + names.contains(&"claude-opus-5"), + "regression: claude-opus-5 must remain in known models" + ); + } +} From 374ea0f2e8a6e813f21f392e3a034f0ca63dd7c1 Mon Sep 17 00:00:00 2001 From: Wolfe-Jam Date: Fri, 31 Jul 2026 18:29:29 -0400 Subject: [PATCH 2/3] style(anthropic): rustfmt known_models unit tests --- crates/goose-providers/src/anthropic.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/goose-providers/src/anthropic.rs b/crates/goose-providers/src/anthropic.rs index f7c5ecf446d5..4020ad02adfb 100644 --- a/crates/goose-providers/src/anthropic.rs +++ b/crates/goose-providers/src/anthropic.rs @@ -471,8 +471,14 @@ mod known_models_tests { .position(|&m| m == "claude-fable-5") .expect("claude-fable-5 present"); // Claude 5 entries should sit with opus-5 at the head, before 4.x legacy blocks - assert!(sonnet < 5, "claude-sonnet-5 should be near the top of the list"); - assert!(fable < 5, "claude-fable-5 should be near the top of the list"); + assert!( + sonnet < 5, + "claude-sonnet-5 should be near the top of the list" + ); + assert!( + fable < 5, + "claude-fable-5 should be near the top of the list" + ); } #[test] From 3decde3268dd6cd69dcdc502463356a6c69ab5de Mon Sep 17 00:00:00 2001 From: Wolfe-Jam Date: Sun, 2 Aug 2026 13:08:12 -0400 Subject: [PATCH 3/3] fix(anthropic): drop known_models tests and comment per review Address angiejones review on #10865: list membership tests were tautological for a static list add; keep the two model entries only. --- crates/goose-providers/src/anthropic.rs | 58 ------------------------- 1 file changed, 58 deletions(-) diff --git a/crates/goose-providers/src/anthropic.rs b/crates/goose-providers/src/anthropic.rs index 4020ad02adfb..ee35ec273f7b 100644 --- a/crates/goose-providers/src/anthropic.rs +++ b/crates/goose-providers/src/anthropic.rs @@ -30,7 +30,6 @@ pub const ANTHROPIC_DEFAULT_MODEL: &str = "claude-sonnet-4-5"; pub const ANTHROPIC_DEFAULT_FAST_MODEL: &str = "claude-haiku-4-5"; const ANTHROPIC_KNOWN_MODELS: &[&str] = &[ "claude-opus-5", - // Claude 5 family — pre-key picker (registry already has these; list was lagging) "claude-sonnet-5", "claude-fable-5", "claude-opus-4-8", @@ -442,60 +441,3 @@ pub fn from_declarative_config( .skip_canonical_filtering(config.skip_canonical_filtering) .format_options(format_options)) } - -#[cfg(test)] -mod known_models_tests { - use super::*; - - #[test] - fn known_models_includes_claude_sonnet_5_and_fable_5() { - assert!( - ANTHROPIC_KNOWN_MODELS.contains(&"claude-sonnet-5"), - "claude-sonnet-5 must appear in the pre-key Anthropic model list" - ); - assert!( - ANTHROPIC_KNOWN_MODELS.contains(&"claude-fable-5"), - "claude-fable-5 must appear in the pre-key Anthropic model list" - ); - } - - #[test] - fn known_models_keep_opus_5_and_list_claude_5_newest_first() { - assert_eq!(ANTHROPIC_KNOWN_MODELS[0], "claude-opus-5"); - let sonnet = ANTHROPIC_KNOWN_MODELS - .iter() - .position(|&m| m == "claude-sonnet-5") - .expect("claude-sonnet-5 present"); - let fable = ANTHROPIC_KNOWN_MODELS - .iter() - .position(|&m| m == "claude-fable-5") - .expect("claude-fable-5 present"); - // Claude 5 entries should sit with opus-5 at the head, before 4.x legacy blocks - assert!( - sonnet < 5, - "claude-sonnet-5 should be near the top of the list" - ); - assert!( - fable < 5, - "claude-fable-5 should be near the top of the list" - ); - } - - #[test] - fn metadata_surfaces_claude_5_models_for_pre_key_picker() { - let meta = AnthropicProvider::metadata(); - let names: Vec<&str> = meta.known_models.iter().map(|m| m.name.as_str()).collect(); - assert!( - names.contains(&"claude-sonnet-5"), - "ProviderMetadata must expose claude-sonnet-5 before API key is set" - ); - assert!( - names.contains(&"claude-fable-5"), - "ProviderMetadata must expose claude-fable-5 before API key is set" - ); - assert!( - names.contains(&"claude-opus-5"), - "regression: claude-opus-5 must remain in known models" - ); - } -}