Merge 9689d204f75296fbd33eaf9f076c2c5055b7be12 into 598f1826d8b2bc969aace2c6459824737667218c

This commit is contained in:
Tomi 2026-03-21 03:15:11 +00:00 committed by GitHub
commit eb68fea243
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,6 +61,12 @@ function resolveToolErrorWarningPolicy(params: {
verboseLevel?: VerboseLevel;
}): ToolErrorWarningPolicy {
const includeDetails = isVerboseToolDetailEnabled(params.verboseLevel);
// Check suppressToolErrors first so it takes precedence over all other rules.
// When true, no tool-error warnings are shown to the user — the agent handles
// failures internally and decides what to communicate.
if (params.suppressToolErrors) {
return { showWarning: false, includeDetails };
}
if (params.suppressToolErrorWarnings) {
return { showWarning: false, includeDetails };
}
@ -79,9 +85,6 @@ function resolveToolErrorWarningPolicy(params: {
if (isMutatingToolError) {
return { showWarning: true, includeDetails };
}
if (params.suppressToolErrors) {
return { showWarning: false, includeDetails };
}
return {
showWarning: !params.hasUserFacingReply && !isRecoverableToolError(params.lastToolError.error),
includeDetails,