fix(providers): add claude-sonnet-5 to canonical model registry (#10183)

Co-authored-by: syf2211 <syf2211@users.noreply.github.com>
This commit is contained in:
石岳峰
2026-07-02 14:10:35 +08:00
committed by GitHub
parent 8cb6d4766c
commit dbc1f88ca7
5 changed files with 91 additions and 0 deletions
@@ -13242,6 +13242,39 @@
"output": 64000
}
},
{
"id": "amazon-bedrock/global.anthropic.claude-sonnet-5",
"name": "Claude Sonnet 5 (Global)",
"family": "claude-sonnet",
"attachment": true,
"reasoning": true,
"tool_call": true,
"temperature": true,
"knowledge": "2025-08-31",
"release_date": "2026-06-01",
"last_updated": "2026-07-01",
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
},
"open_weights": false,
"cost": {
"input": 3.0,
"output": 15.0,
"cache_read": 0.3,
"cache_write": 3.75
},
"limit": {
"context": 1000000,
"output": 64000
}
},
{
"id": "amazon-bedrock/google.gemma-3-12b-it",
"name": "Google Gemma 3 12B",
@@ -15802,6 +15835,40 @@
"output": 64000
}
},
{
"id": "anthropic/claude-sonnet-5",
"name": "Claude Sonnet 5",
"family": "claude-sonnet",
"attachment": true,
"reasoning": true,
"thinking_mode": "adaptive",
"tool_call": true,
"temperature": true,
"knowledge": "2025-08-31",
"release_date": "2026-06-01",
"last_updated": "2026-07-01",
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
},
"open_weights": false,
"cost": {
"input": 3.0,
"output": 15.0,
"cache_read": 0.3,
"cache_write": 3.75
},
"limit": {
"context": 1000000,
"output": 64000
}
},
{
"id": "anyapi/anthropic/claude-haiku-4.5",
"name": "Claude Haiku 4.5 (latest)",
@@ -390,6 +390,14 @@ mod tests {
map_to_canonical_model("bedrock", "claude-3-5-sonnet", r),
Some("anthropic/claude-3.5-sonnet".to_string())
);
assert_eq!(
map_to_canonical_model("aws_bedrock", "global.anthropic.claude-sonnet-5", r),
Some("amazon-bedrock/global.anthropic.claude-sonnet-5".to_string())
);
assert_eq!(
map_to_canonical_model("anthropic", "claude-sonnet-5", r),
Some("anthropic/claude-sonnet-5".to_string())
);
// === OpenAI GPT ===
assert_eq!(
+14
View File
@@ -564,6 +564,20 @@ mod tests {
assert_eq!(config.max_output_tokens(), 4_096);
}
#[test]
fn resolves_claude_sonnet_5_on_aws_bedrock() {
let _guard = env_lock::lock_env([
("GOOSE_MAX_TOKENS", None::<&str>),
("GOOSE_CONTEXT_LIMIT", None::<&str>),
]);
let config = ModelConfig::new("global.anthropic.claude-sonnet-5")
.with_canonical_limits("aws_bedrock");
assert_eq!(config.context_limit, Some(1_000_000));
assert_eq!(config.max_tokens, Some(64_000));
assert_eq!(config.reasoning, Some(true));
}
#[test]
fn unknown_model_leaves_fields_none() {
let _guard = env_lock::lock_env([
@@ -361,6 +361,7 @@ fn inferred_thinking_mode(canonical_id: &str) -> Option<ThinkingMode> {
"anthropic/claude-opus-4.7" => Some(ThinkingMode::Adaptive),
"anthropic/claude-opus-4.8" => Some(ThinkingMode::Adaptive),
"anthropic/claude-sonnet-4.6" => Some(ThinkingMode::Adaptive),
"anthropic/claude-sonnet-5" => Some(ThinkingMode::Adaptive),
_ => None,
}
}
+1
View File
@@ -37,6 +37,7 @@ pub const BEDROCK_DOC_LINK: &str =
pub const BEDROCK_DEFAULT_MODEL: &str = "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
pub const BEDROCK_KNOWN_MODELS: &[&str] = &[
"global.anthropic.claude-sonnet-5",
"us.anthropic.claude-sonnet-4-5-20250929-v1:0",
"us.anthropic.claude-sonnet-4-20250514-v1:0",
"us.anthropic.claude-3-7-sonnet-20250219-v1:0",