mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 23:16:57 +00:00
feat: add messages.suppressToolErrors config option
This commit is contained in:
@@ -233,7 +233,7 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
const isMutatingToolError =
|
||||
params.lastToolError.mutatingAction ??
|
||||
isLikelyMutatingToolName(params.lastToolError.toolName);
|
||||
const shouldShowToolError = isMutatingToolError || (!hasUserFacingReply && !isRecoverableError);
|
||||
const shouldShowToolError = isMutatingToolError || (!hasUserFacingReply && !isRecoverableError && !params.config?.messages?.suppressToolErrors);
|
||||
|
||||
// Always surface mutating tool failures so we do not silently confirm actions that did not happen.
|
||||
// Otherwise, keep the previous behavior and only surface non-recoverable failures when no reply exists.
|
||||
|
||||
@@ -325,6 +325,8 @@ export const FIELD_HELP: Record<string, string> = {
|
||||
"Max reply-back turns between requester and target (0–5).",
|
||||
"channels.telegram.customCommands":
|
||||
"Additional Telegram bot menu commands (merged with native; conflicts ignored).",
|
||||
"messages.suppressToolErrors":
|
||||
"When true, suppress ⚠️ tool-error warnings from being shown to the user. The agent already sees errors in context and can retry. Default: false.",
|
||||
"messages.ackReaction": "Emoji reaction used to acknowledge inbound messages (empty disables).",
|
||||
"messages.ackReactionScope":
|
||||
'When to send ack reactions ("group-mentions", "group-all", "direct", "all").',
|
||||
|
||||
@@ -219,6 +219,7 @@ export const FIELD_LABELS: Record<string, string> = {
|
||||
"browser.remoteCdpHandshakeTimeoutMs": "Remote CDP Handshake Timeout (ms)",
|
||||
"session.dmScope": "DM Session Scope",
|
||||
"session.agentToAgent.maxPingPongTurns": "Agent-to-Agent Ping-Pong Turns",
|
||||
"messages.suppressToolErrors": "Suppress Tool Error Warnings",
|
||||
"messages.ackReaction": "Ack Reaction Emoji",
|
||||
"messages.ackReactionScope": "Ack Reaction Scope",
|
||||
"messages.inbound.debounceMs": "Inbound Message Debounce (ms)",
|
||||
|
||||
@@ -82,6 +82,8 @@ export type MessagesConfig = {
|
||||
ackReactionScope?: "group-mentions" | "group-all" | "direct" | "all";
|
||||
/** Remove ack reaction after reply is sent (default: false). */
|
||||
removeAckAfterReply?: boolean;
|
||||
/** When true, suppress ⚠️ tool-error warnings from being shown to the user. Default: false. */
|
||||
suppressToolErrors?: boolean;
|
||||
/** Text-to-speech settings for outbound replies. */
|
||||
tts?: TtsConfig;
|
||||
};
|
||||
|
||||
@@ -114,6 +114,7 @@ export const MessagesSchema = z
|
||||
ackReaction: z.string().optional(),
|
||||
ackReactionScope: z.enum(["group-mentions", "group-all", "direct", "all"]).optional(),
|
||||
removeAckAfterReply: z.boolean().optional(),
|
||||
suppressToolErrors: z.boolean().optional(),
|
||||
tts: TtsConfigSchema,
|
||||
})
|
||||
.strict()
|
||||
|
||||
Reference in New Issue
Block a user