Memory-Tools unabhängig vom Workspace verfügbar machen

- Tools werden jetzt auch gesendet wenn kein Workspace aber useMemory=true
- GetToolDefinitions(includeFileTools, includeMemory) für granulare Steuerung
- File-Tools geben saubere Fehlermeldung wenn workspace null
This commit is contained in:
Meleki committed 2026-03-01 15:19:56 +01:00
1 parent 342284dd3e
commit 632424fb73
2 files changed
+23 -13

No files matched your search

+5 -3
View File
@@ -71,10 +71,12 @@ public class AnthropicService
["stream"] = true
};
if (!string.IsNullOrEmpty(workspace))
var hasWorkspace = !string.IsNullOrEmpty(workspace);
var includeMemory = useMemory && _memoryService != null && !string.IsNullOrEmpty(agentId);
if (hasWorkspace || includeMemory)
{
var includeMemory = useMemory && _memoryService != null && !string.IsNullOrEmpty(agentId);
payload["tools"] = _toolService.GetToolDefinitions(includeMemory);
payload["tools"] = _toolService.GetToolDefinitions(includeFileTools: hasWorkspace, includeMemory: includeMemory);
// "any" erzwingt Tool-Nutzung, aber nur in der ersten Iteration,
// damit Claude nicht endlos Tools aufruft wenn die Aufgabe erledigt ist.
var effectiveChoice = (toolChoice == "any" && iterations == 1) ? "any" : "auto";