fix: suppress tool error payloads from user-facing delivery#23147
Closed
ahdernasr wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix: suppress tool error payloads from user-facing delivery#23147ahdernasr wants to merge 1 commit intoopenclaw:mainfrom
ahdernasr wants to merge 1 commit intoopenclaw:mainfrom
Conversation
4f6324f to
1729ba2
Compare
Tool results with isError: true (e.g., file path errors, exec failures, rate limit messages) were being forwarded to the user's chat channel, leaking internal details and file paths. Add an isError guard at the top of resolveToolDeliveryPayload() in the dispatch layer so error payloads are never delivered to any channel (DM, group, or routed). The error is still visible to the model for retry/recovery — only the channel-side delivery is suppressed. This is a single-point fix that covers all tool types and all channels, addressing the root cause behind openclaw#17828, openclaw#12928, and openclaw#20279. Tests: 3 new cases covering DM, group, and media-bearing error payloads.
1729ba2 to
351c08d
Compare
Contributor
|
Hmm - as a user I kinda wanna see when something fails tho? please use codex to review:
|
Contributor
|
Superseding update: we shipped this directly to What landed
Verification run
Given these are already on |
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.
Problem
Tool results with
isError: true(e.g., file path validation errors, exec failures, rate limit messages) are forwarded to the user's chat channel. This leaks internal details like file paths, stack traces, and infrastructure error messages that users should never see.Example from production:
This is a systemic issue affecting all tool types and all channels. Multiple issues have been filed:
isError: true) leak to user as messagesAnd multiple partial fixes have been attempted (#17950, #10261, #17552), each targeting specific tool types rather than the root cause.
Fix
Add an
isErrorguard at the top ofresolveToolDeliveryPayload()indispatch-from-config.ts. When a tool result hasisError: true, the payload is suppressed from channel delivery entirely.This is a single-point fix at the dispatch layer that covers:
The error payload is still visible to the model (so it can react, retry, or inform the user in its own words) — only the raw channel-side delivery is suppressed.
Changes
dispatch-from-config.ts: 8-line guard at the top ofresolveToolDeliveryPayload()dispatch-from-config.test.ts: 3 new test cases:Testing
All 18 tests pass (15 existing + 3 new).
Follow-up to #21231 (tool result serialization) — same dispatch area, different bug.
Greptile Summary
Adds a security fix that prevents internal tool error details from leaking to user-facing channels. The fix adds an
isErrorguard at the top ofresolveToolDeliveryPayload()in dispatch-from-config.ts:331-333, which suppresses all tool results withisError: truefrom being delivered to users while still making them visible to the model for retry/recovery logic.Key changes:
Confidence Score: 5/5
Last reviewed commit: 4f6324f
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!