From ed8e5af4284b42eaad77a8eb63f9655d5b94e377 Mon Sep 17 00:00:00 2001 From: Meleki Date: Fri, 13 Mar 2026 09:17:42 +0100 Subject: [PATCH] =?UTF-8?q?fix(web-search):=20Kommentar=20f=C3=BCr=202026e?= =?UTF-8?q?r=20Auto-Injection=20+=20Code-Execution=20Beta-Header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - web_search_20260209 injected code_execution automatisch – nicht manuell hinzufügen - Beta-Header code-execution-2025-08-25 hinzugefügt (für zukünftige Kompatibilität) --- Services/AnthropicService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"));