fix: tool_end SSE-Event nicht mehr auf 500 Zeichen kürzen + tool_result History-Truncation

- tool_end SSE-Event: 500-Zeichen-Limit entfernt (2 Stellen), damit
  todo_write und andere Tools beim Streaming vollständig angezeigt werden
- BuildHistoryFromDb: TruncateToolResult (20k) auf tool_result-Messages
  angewendet, um Token-Overflow bei History-Rebuild zu verhindern
  (609k Tokens > 200k Limit nach awaiting_user_choice)
- TruncateToolResult/MaxToolResultChars auf internal geändert
- TODO.md: todo_write-Bug als erledigt markiert
This commit is contained in:
Meleki committed 2026-03-09 09:40:30 +01:00
1 parent dcedbaa074
commit cdad7faad4
3 files changed
+7 -7

No files matched your search

+4 -4
View File
@@ -741,7 +741,7 @@ public class AnthropicService
toolName,
toolId,
input = toolInput.ToString(),
result = toolResult.Length > 500 ? toolResult[..500] + "..." : toolResult,
result = toolResult,
isError,
agentName
}, cancellationToken);
@@ -1195,7 +1195,7 @@ public class AnthropicService
{
name = currentToolName,
input = currentToolInputJson.ToString(),
result = toolResult.Length > 500 ? toolResult[..500] + "..." : toolResult,
result = toolResult,
isError
}, cancellationToken);
}
@@ -1293,9 +1293,9 @@ public class AnthropicService
// ── Shared Helpers ──
private const int MaxToolResultChars = 20_000;
internal const int MaxToolResultChars = 20_000;
private static string TruncateToolResult(string result)
internal static string TruncateToolResult(string result)
{
return result.Length > MaxToolResultChars
? result[..MaxToolResultChars] + $"\n\n[... gekürzt, {result.Length - MaxToolResultChars} weitere Zeichen ...]"