From c4177a2fa2286009e89d9b1e1f68e77e63e523a3 Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Wed, 1 Jul 2026 00:23:37 +0530 Subject: [PATCH 1/2] feat: add Claude Sonnet 5 to all providers --- .../forge_app/src/dto/anthropic/response.rs | 5 ++ .../transformers/model_specific_reasoning.rs | 1 + crates/forge_repo/src/provider/anthropic.rs | 2 +- crates/forge_repo/src/provider/provider.json | 70 +++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) diff --git a/crates/forge_app/src/dto/anthropic/response.rs b/crates/forge_app/src/dto/anthropic/response.rs index d964b05953..8837a25604 100644 --- a/crates/forge_app/src/dto/anthropic/response.rs +++ b/crates/forge_app/src/dto/anthropic/response.rs @@ -84,6 +84,11 @@ fn get_context_length(model_id: &str) -> Option { return Some(1_000_000); } + // Claude Sonnet 5 (1M context) + if model_id.starts_with("claude-sonnet-5") { + return Some(1_000_000); + } + // Current models (200K context) if model_id.starts_with("claude-sonnet-4-5-") || model_id.starts_with("claude-haiku-4-5-") diff --git a/crates/forge_app/src/transformers/model_specific_reasoning.rs b/crates/forge_app/src/transformers/model_specific_reasoning.rs index d003eb1719..4c74b595b8 100644 --- a/crates/forge_app/src/transformers/model_specific_reasoning.rs +++ b/crates/forge_app/src/transformers/model_specific_reasoning.rs @@ -40,6 +40,7 @@ impl ModelSpecificReasoning { AnthropicModelFamily::AdaptiveOnly } else if id.contains("opus-4-6") || id.contains("46-opus") + || id.contains("sonnet-5") || id.contains("sonnet-4-6") || id.contains("46-sonnet") { diff --git a/crates/forge_repo/src/provider/anthropic.rs b/crates/forge_repo/src/provider/anthropic.rs index 009568bcdb..28171fb1b4 100644 --- a/crates/forge_repo/src/provider/anthropic.rs +++ b/crates/forge_repo/src/provider/anthropic.rs @@ -92,7 +92,7 @@ impl Anthropic { } /// Returns false when the model auto-enables interleaved thinking through -/// adaptive thinking (Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 4.6). When the model +/// adaptive thinking (Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5, Sonnet 4.6). When the model /// is unknown (e.g., listing endpoints), the flag is included because it is /// harmless on non-chat endpoints and necessary on older chat models. fn interleaved_thinking_required(model: Option<&ModelId>) -> bool { diff --git a/crates/forge_repo/src/provider/provider.json b/crates/forge_repo/src/provider/provider.json index ac73677281..fa2833120a 100644 --- a/crates/forge_repo/src/provider/provider.json +++ b/crates/forge_repo/src/provider/provider.json @@ -664,6 +664,16 @@ "supports_reasoning": true, "input_modalities": ["text", "image"] }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, { "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6", @@ -1453,6 +1463,46 @@ "supports_reasoning": true, "input_modalities": ["text"] }, + { + "id": "global.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (Global)", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, + { + "id": "us.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (US)", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, + { + "id": "eu.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (EU)", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, + { + "id": "anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, { "id": "global.anthropic.claude-sonnet-4-6", "name": "Claude Sonnet 4.6 (Global)", @@ -2305,6 +2355,16 @@ "supports_reasoning": true, "input_modalities": ["text", "image"] }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, { "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6", @@ -2847,6 +2907,16 @@ "supports_reasoning": true, "input_modalities": ["text", "image"] }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "description": "The best combination of speed and intelligence", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, { "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6", From efed13a9e0fbbc3394dbf5140f8319d283de0948 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 18:55:50 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- crates/forge_repo/src/provider/anthropic.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/forge_repo/src/provider/anthropic.rs b/crates/forge_repo/src/provider/anthropic.rs index 28171fb1b4..e6c360afd6 100644 --- a/crates/forge_repo/src/provider/anthropic.rs +++ b/crates/forge_repo/src/provider/anthropic.rs @@ -92,9 +92,9 @@ impl Anthropic { } /// Returns false when the model auto-enables interleaved thinking through -/// adaptive thinking (Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5, Sonnet 4.6). When the model -/// is unknown (e.g., listing endpoints), the flag is included because it is -/// harmless on non-chat endpoints and necessary on older chat models. +/// adaptive thinking (Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5, Sonnet 4.6). When +/// the model is unknown (e.g., listing endpoints), the flag is included because +/// it is harmless on non-chat endpoints and necessary on older chat models. fn interleaved_thinking_required(model: Option<&ModelId>) -> bool { let Some(model) = model else { return true }; let id = model.as_str().to_lowercase();