@@ -24,10 +24,7 @@ import {
2424 normalizeTextForComparison ,
2525} from "../../pi-embedded-helpers.js" ;
2626import type { ToolResultFormat } from "../../pi-embedded-subscribe.shared-types.js" ;
27- import {
28- extractAssistantThinking ,
29- extractAssistantVisibleText ,
30- } from "../../pi-embedded-utils.js" ;
27+ import { extractAssistantThinking , extractAssistantVisibleText } from "../../pi-embedded-utils.js" ;
3128import { isExecLikeToolName , type ToolErrorSummary } from "../../tool-error-summary.js" ;
3229import { isLikelyMutatingToolName } from "../../tool-mutation.js" ;
3330
@@ -48,7 +45,7 @@ const RECOVERABLE_TOOL_ERROR_KEYWORDS = [
4845] as const ;
4946
5047const MUTATING_FAILURE_ACTION_PATTERN =
51- "(?:write|edit|update|save|create|delete|remove|modify|change|apply|patch|move|rename|send|reply|message|tool|action|operation)" ;
48+ "(?:write|edit|update|save|create|delete|remove|modify|change|apply|patch|move|rename|send|reply|message|run|execute|execution|command|script|shell|bash|exec| tool|action|operation)" ;
5249
5350const MUTATING_FAILURE_INABILITY_PATTERN = new RegExp (
5451 `\\b(?:couldn't|could not|can't|cannot|unable to|am unable to|wasn't able to|was not able to|were unable to)\\b.{0,100}\\b${ MUTATING_FAILURE_ACTION_PATTERN } \\b` ,
@@ -143,9 +140,6 @@ function resolveToolErrorWarningPolicy(params: {
143140 if ( params . suppressToolErrorWarnings ) {
144141 return { showWarning : false , includeDetails } ;
145142 }
146- if ( isExecLikeToolName ( params . lastToolError . toolName ) && ! includeDetails ) {
147- return { showWarning : false , includeDetails } ;
148- }
149143 // sessions_send timeouts and errors are transient inter-session communication
150144 // issues — the message may still have been delivered. Suppress warnings to
151145 // prevent raw error text from leaking into the chat surface (#23989).
@@ -160,6 +154,9 @@ function resolveToolErrorWarningPolicy(params: {
160154 includeDetails,
161155 } ;
162156 }
157+ if ( isExecLikeToolName ( params . lastToolError . toolName ) && ! includeDetails ) {
158+ return { showWarning : false , includeDetails } ;
159+ }
163160 if ( params . suppressToolErrors ) {
164161 return { showWarning : false , includeDetails } ;
165162 }
0 commit comments