fix: suppress mutating tool error warnings#84277
Closed
jalehman wants to merge 2 commits into
Closed
Conversation
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. |
Contributor
Author
|
Closing as duplicate of #81561, which carries the same fix. Prefer the existing contributor PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
messages.suppressToolErrorsbefore mutating-tool warning generation.sessions_send, exec-timeout detail, and explicitsuppressToolErrorWarningsbehavior.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.tsnode --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..HEADReal 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
writetool 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.suppressToolErrorsis 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.