Skip to content

fix: suppress mutating tool error warnings#84277

Closed
jalehman wants to merge 2 commits into
mainfrom
jalehman/suppress-mutating-tool-error-warnings
Closed

fix: suppress mutating tool error warnings#84277
jalehman wants to merge 2 commits into
mainfrom
jalehman/suppress-mutating-tool-error-warnings

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

Summary

  • Honor messages.suppressToolErrors before mutating-tool warning generation.
  • Preserve existing sessions_send, exec-timeout detail, and explicit suppressToolErrorWarnings behavior.
  • Add regression coverage for mutating tool errors plus an Unreleased changelog entry.

Existing related PR: #81561 covers the same issue, but its Real behavior proof check is failing because the proof fields do not match the current parser contract. This PR keeps the fix narrow and includes the required proof fields below.

Verification

  • node scripts/run-vitest.mjs src/agents/pi-embedded-runner/run/payloads.errors.test.ts
  • node --import tsx -e 'import { buildEmbeddedRunPayloads } from "./src/agents/pi-embedded-runner/run/payloads.ts"; const payloads = buildEmbeddedRunPayloads({ assistantTexts: [], toolMetas: [], lastAssistant: undefined, isCronTrigger: false, sessionKey: "agent:main:telegram:group:-1003998880259:topic:1", inlineToolResultsAllowed: false, verboseLevel: "off", reasoningLevel: "off", toolResultFormat: "plain", lastToolError: { toolName: "write", error: "connection timeout" }, config: { messages: { suppressToolErrors: true } } }); console.log(JSON.stringify({scenario:"mutating write tool error with messages.suppressToolErrors=true", payloadCount: payloads.length, payloadTexts: payloads.map((p) => p.text)}, null, 2));'
  • git diff --check HEAD~2..HEAD

Real behavior proof

Behavior addressed: When messages.suppressToolErrors=true, mutating tool failures such as write/message/apply-patch failures should not emit separate user-facing warning bubbles.

Real environment tested: Local OpenClaw source checkout on the Phaedrus VPS, using the Telegram session key shape from the observed failing group chat.

Exact steps or command run after this patch: Ran the payload builder directly with a mutating write tool failure, messages.suppressToolErrors=true, and a Telegram group session key:

node --import tsx -e 'import { buildEmbeddedRunPayloads } from "./src/agents/pi-embedded-runner/run/payloads.ts"; const payloads = buildEmbeddedRunPayloads({ assistantTexts: [], toolMetas: [], lastAssistant: undefined, isCronTrigger: false, sessionKey: "agent:main:telegram:group:-1003998880259:topic:1", inlineToolResultsAllowed: false, verboseLevel: "off", reasoningLevel: "off", toolResultFormat: "plain", lastToolError: { toolName: "write", error: "connection timeout" }, config: { messages: { suppressToolErrors: true } } }); console.log(JSON.stringify({scenario:"mutating write tool error with messages.suppressToolErrors=true", payloadCount: payloads.length, payloadTexts: payloads.map((p) => p.text)}, null, 2));'

Evidence after fix:

{
  "scenario": "mutating write tool error with messages.suppressToolErrors=true",
  "payloadCount": 0,
  "payloadTexts": []
}

Observed result after fix: The mutating tool failure produced zero outbound payloads, so no Telegram warning bubble would be delivered when messages.suppressToolErrors is enabled.

What was not tested: I did not deploy this branch into the live root-owned OpenClaw install on Phaedrus; live Telegram validation will happen after this PR is merged/released or otherwise deployed.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: suppress mutating tool error warnings This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@jalehman

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #81561, which carries the same fix. Prefer the existing contributor PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant