diff --git a/Services/AnthropicService.cs b/Services/AnthropicService.cs index 5a730f2..fd397d6 100644 --- a/Services/AnthropicService.cs +++ b/Services/AnthropicService.cs @@ -1640,7 +1640,10 @@ public class AnthropicService tools.AddRange(allTools); } if (hasWebSearch) + { tools.Add(new { type = webSearchVersion, name = "web_search", max_uses = 5 }); + // web_search_20260209: Code Execution wird von der API automatisch injected – NICHT manuell hinzufügen! + } payload["tools"] = tools; var effectiveChoice = (!planMode && toolChoice == "any" && iteration == 1) ? "any" : "auto"; payload["tool_choice"] = new { type = effectiveChoice }; @@ -1695,7 +1698,7 @@ public class AnthropicService var client = _httpFactory.CreateClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _token); client.DefaultRequestHeaders.Add("anthropic-version", "2023-06-01"); - client.DefaultRequestHeaders.Add("anthropic-beta", "claude-code-20250219,oauth-2025-04-20"); + client.DefaultRequestHeaders.Add("anthropic-beta", "claude-code-20250219,oauth-2025-04-20,code-execution-2025-08-25"); client.DefaultRequestHeaders.Add("User-Agent", "claude-cli/2.1.2 (external, cli)"); client.DefaultRequestHeaders.Add("x-app", "cli"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));