fix: honour tool error suppression for mutating tools (#81561) · openclaw/openclaw@9c00268
moeedahmed
·
2026-05-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -67,6 +67,7 @@ Docs: https://docs.openclaw.ai
|
67 | 67 | - Agents/compaction: bound plugin-owned CLI transcript compaction with the host safety timeout so a hung context engine can no longer stall post-turn cleanup. (#84083) Thanks @100yenadmin. |
68 | 68 | - Control UI/usage: truncate long context skill, tool, and file names in the usage panel while keeping the full name available on hover. (#42197) Thanks @Rain120. |
69 | 69 | - Codex: respect explicit `models auth order set` and `config.auth.order` precedence over stale `lastGood` in `/codex account`, and show `no working credential` when every explicit-order profile is ineligible instead of marking a lower-ranked profile as active. Fixes #84386. (#84412) Thanks @openperf. |
| 70 | +- Agents: honor `messages.suppressToolErrors` for mutating tool failures so configured chat surfaces do not receive separate warning payloads. (#81561) Thanks @moeedahmed. |
70 | 71 | |
71 | 72 | ## 2026.5.19 |
72 | 73 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -417,13 +417,14 @@ describe("buildEmbeddedRunPayloads", () => {
|
417 | 417 | |
418 | 418 | it.each([ |
419 | 419 | { |
420 | | -name: "still shows mutating tool errors when messages.suppressToolErrors is enabled", |
| 420 | +name: "suppresses mutating tool errors when messages.suppressToolErrors is enabled", |
421 | 421 | payload: { |
422 | 422 | lastToolError: { toolName: "write", error: "connection timeout" }, |
423 | 423 | config: { messages: { suppressToolErrors: true } }, |
424 | 424 | }, |
425 | 425 | title: "Write", |
426 | 426 | absentDetail: "connection timeout", |
| 427 | +suppressed: true, |
427 | 428 | }, |
428 | 429 | { |
429 | 430 | name: "shows recoverable tool errors for mutating tools", |
@@ -441,8 +442,12 @@ describe("buildEmbeddedRunPayloads", () => {
|
441 | 442 | title: "Browser", |
442 | 443 | absentDetail: "connection timeout", |
443 | 444 | }, |
444 | | -])("$name", ({ payload, title, absentDetail }) => { |
| 445 | +])("$name", ({ payload, title, absentDetail, suppressed }) => { |
445 | 446 | const payloads = buildPayloads(payload); |
| 447 | +if (suppressed) { |
| 448 | +expect(payloads).toEqual([]); |
| 449 | +return; |
| 450 | +} |
446 | 451 | expectSingleToolErrorPayload(payloads, { title, absentDetail }); |
447 | 452 | }); |
448 | 453 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -162,6 +162,9 @@ function resolveToolErrorWarningPolicy(params: {
|
162 | 162 | if (normalizedToolName === "sessions_send") { |
163 | 163 | return { showWarning: false, includeDetails }; |
164 | 164 | } |
| 165 | +if (params.suppressToolErrors) { |
| 166 | +return { showWarning: false, includeDetails }; |
| 167 | +} |
165 | 168 | const isMutatingToolError = |
166 | 169 | params.lastToolError.mutatingAction ?? isLikelyMutatingToolName(params.lastToolError.toolName); |
167 | 170 | if (isMutatingToolError) { |
@@ -173,9 +176,6 @@ function resolveToolErrorWarningPolicy(params: {
|
173 | 176 | if (isExecLikeToolName(params.lastToolError.toolName) && !includeDetails) { |
174 | 177 | return { showWarning: false, includeDetails }; |
175 | 178 | } |
176 | | -if (params.suppressToolErrors) { |
177 | | -return { showWarning: false, includeDetails }; |
178 | | -} |
179 | 179 | return { |
180 | 180 | showWarning: !params.hasUserFacingReply && !isRecoverableToolError(params.lastToolError.error), |
181 | 181 | includeDetails, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。