惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
D
Docker
有赞技术团队
有赞技术团队
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
H
Help Net Security
美团技术团队
MyScale Blog
MyScale Blog
B
Blog RSS Feed
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
G
Google Developers Blog
月光博客
月光博客
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(telegram): hide acknowledged failed-tool warnings fro...
vincentkoc · 2026-04-27 · via Recent Commits to openclaw:main

@@ -44,11 +44,54 @@ const RECOVERABLE_TOOL_ERROR_KEYWORDS = [

4444

"requires",

4545

] as const;

464647+

const MUTATING_FAILURE_ACTION_PATTERN =

48+

"(?:write|edit|update|save|create|delete|remove|modify|change|apply|patch|move|rename|send|reply|message|tool|action|operation)";

49+50+

const MUTATING_FAILURE_INABILITY_PATTERN = new RegExp(

51+

`\\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`,

52+

"u",

53+

);

54+

const MUTATING_FAILURE_ACTION_THEN_FAILURE_PATTERN = new RegExp(

55+

`\\b${MUTATING_FAILURE_ACTION_PATTERN}\\b.{0,100}\\b(?:failed|failure|errored)\\b`,

56+

"u",

57+

);

58+

const MUTATING_FAILURE_FAILURE_THEN_ACTION_PATTERN = new RegExp(

59+

`\\b(?:failed|failure)\\b.{0,100}\\b${MUTATING_FAILURE_ACTION_PATTERN}\\b`,

60+

"u",

61+

);

62+

const MUTATING_FAILURE_ERROR_WHILE_ACTION_PATTERN = new RegExp(

63+

`\\b(?:hit|encountered|ran into)\\b.{0,60}\\berror\\b.{0,100}\\b(?:while|trying to|when)\\b.{0,100}\\b${MUTATING_FAILURE_ACTION_PATTERN}\\b`,

64+

"u",

65+

);

66+

const DID_NOT_FAIL_PATTERN = /\b(?:did not|didn't)\s+fail\b/u;

67+

const NEGATED_FAILURE_PATTERN = /\b(?:no|not|without)\s+(?:failures?|errors?)\b/u;

68+4769

function isRecoverableToolError(error: string | undefined): boolean {

4870

const errorLower = normalizeOptionalLowercaseString(error) ?? "";

4971

return RECOVERABLE_TOOL_ERROR_KEYWORDS.some((keyword) => errorLower.includes(keyword));

5072

}

517374+

function hasExplicitMutatingToolFailureAcknowledgement(text: string): boolean {

75+

const normalizedText = normalizeTextForComparison(text);

76+

if (!normalizedText) {

77+

return false;

78+

}

79+

if (DID_NOT_FAIL_PATTERN.test(normalizedText)) {

80+

return false;

81+

}

82+

if (MUTATING_FAILURE_INABILITY_PATTERN.test(normalizedText)) {

83+

return true;

84+

}

85+

if (NEGATED_FAILURE_PATTERN.test(normalizedText)) {

86+

return false;

87+

}

88+

return (

89+

MUTATING_FAILURE_ACTION_THEN_FAILURE_PATTERN.test(normalizedText) ||

90+

MUTATING_FAILURE_FAILURE_THEN_ACTION_PATTERN.test(normalizedText) ||

91+

MUTATING_FAILURE_ERROR_WHILE_ACTION_PATTERN.test(normalizedText)

92+

);

93+

}

94+5295

function isVerboseToolDetailEnabled(level?: VerboseLevel): boolean {

5396

return level === "on" || level === "full";

5497

}

@@ -84,6 +127,7 @@ function shouldIncludeToolErrorDetails(params: {

84127

function resolveToolErrorWarningPolicy(params: {

85128

lastToolError: ToolErrorSummary;

86129

hasUserFacingReply: boolean;

130+

hasUserFacingFailureAcknowledgement: boolean;

87131

suppressToolErrors: boolean;

88132

suppressToolErrorWarnings?: boolean;

89133

isCronTrigger?: boolean;

@@ -107,7 +151,10 @@ function resolveToolErrorWarningPolicy(params: {

107151

const isMutatingToolError =

108152

params.lastToolError.mutatingAction ?? isLikelyMutatingToolName(params.lastToolError.toolName);

109153

if (isMutatingToolError) {

110-

return { showWarning: true, includeDetails };

154+

return {

155+

showWarning: !params.hasUserFacingFailureAcknowledgement,

156+

includeDetails,

157+

};

111158

}

112159

if (params.suppressToolErrors) {

113160

return { showWarning: false, includeDetails };

@@ -316,6 +363,7 @@ export function buildEmbeddedRunPayloads(params: {

316363

).filter((text) => !shouldSuppressRawErrorText(text));

317364318365

let hasUserFacingAssistantReply = false;

366+

let hasUserFacingFailureAcknowledgement = false;

319367

for (const text of answerTexts) {

320368

const {

321369

text: cleanedText,

@@ -337,20 +385,24 @@ export function buildEmbeddedRunPayloads(params: {

337385

replyToCurrent,

338386

});

339387

hasUserFacingAssistantReply = true;

388+

if (cleanedText && hasExplicitMutatingToolFailureAcknowledgement(cleanedText)) {

389+

hasUserFacingFailureAcknowledgement = true;

390+

}

340391

}

341392342393

if (params.lastToolError) {

343394

const warningPolicy = resolveToolErrorWarningPolicy({

344395

lastToolError: params.lastToolError,

345396

hasUserFacingReply: hasUserFacingAssistantReply,

397+

hasUserFacingFailureAcknowledgement,

346398

suppressToolErrors: Boolean(params.config?.messages?.suppressToolErrors),

347399

suppressToolErrorWarnings: params.suppressToolErrorWarnings,

348400

isCronTrigger: params.isCronTrigger,

349401

sessionKey: params.sessionKey,

350402

verboseLevel: params.verboseLevel,

351403

});

352404353-

// Always surface mutating tool failures so we do not silently confirm actions that did not happen.

405+

// Surface mutating failures unless the assistant explicitly acknowledged the failed action.

354406

// Otherwise, keep the previous behavior and only surface non-recoverable failures when no reply exists.

355407

if (warningPolicy.showWarning) {

356408

const toolSummary = formatToolAggregate(