fix: suppress sessions_send error warnings from leaking to chat (#23989)

sessions_send timeout/error results were being surfaced as raw warning
messages in Telegram chats because the tool is classified as mutating,
which forces error warnings to always be shown. However, sessions_send
failures are transient inter-session communication issues where the
message may still have been delivered, so they should not leak to users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Glucksberg
2026-02-23 02:29:22 +00:00
committed by Peter Steinberger
parent 9cc7450edf
commit 947883d2e0

View File

@@ -67,6 +67,12 @@ function resolveToolErrorWarningPolicy(params: {
if ((normalizedToolName === "exec" || normalizedToolName === "bash") && !includeDetails) {
return { showWarning: false, includeDetails };
}
// sessions_send timeouts and errors are transient inter-session communication
// issues — the message may still have been delivered. Suppress warnings to
// prevent raw error text from leaking into the chat surface (#23989).
if (normalizedToolName === "sessions_send") {
return { showWarning: false, includeDetails };
}
const isMutatingToolError =
params.lastToolError.mutatingAction ?? isLikelyMutatingToolName(params.lastToolError.toolName);
if (isMutatingToolError) {