#17950: fix: filter error payloads from user-facing messages
stale
size: XS
Cluster:
Error Payload Filtering
## Summary
- `isRenderablePayload()` did not check the `isError` flag on payloads
- Internal error results (context overflow, tool failures, role ordering conflicts) were being sent to users on all messaging channels
- These errors are meant to stay in the agent context for self-correction, not be delivered to end users
## Changes
- Added early return in `isRenderablePayload()` when `payload.isError` is true
- Added test coverage for `isRenderablePayload` covering all payload types and the isError filtering
Fixes #17828
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Prevents internal error messages from being sent to end users by filtering out error payloads. The fix adds an early return in `isRenderablePayload()` to check the `isError` flag, ensuring that context overflow errors, tool failures, and role ordering conflicts stay in the agent context for self-correction rather than being delivered on messaging channels.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The fix is a simple, well-tested guard clause that prevents a clear bug (error messages leaking to users). The change is minimal, isolated to a single function, and includes comprehensive test coverage. No edge cases or regressions identified.
- No files require special attention
<sub>Last reviewed commit: b981813</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19339: fix(heartbeat): skip isError payloads when resolving heartbeat reply
by aldoeliacim · 2026-02-17
79.9%
#19406: fix(heartbeat): filter error payloads from heartbeat reply selection
by namabile · 2026-02-17
79.7%
#21454: fix(cron): skip isError payloads when picking summary/delivery content
by Diaspar4u · 2026-02-19
78.5%
#19387: Fix #19302: Filter isError payloads before heartbeat selection
by cedillarack · 2026-02-17
77.9%
#3864: fix(agents): suppress exec/bash exit code errors from user display
by HirokiKobayashi-R · 2026-01-29
77.6%
#19451: fix(errors): surface provider hint for role-ordering failures
by rafaelipuente · 2026-02-17
76.7%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
76.1%
#8661: fix: display rate limit errors correctly instead of as context over...
by dbottme · 2026-02-04
75.0%
#8175: fix: suppress raw API errors for non-owners
by Rakshi2609 · 2026-02-03
74.7%
#2541: fix(agents): add error handling to orphaned message cleanup
by Episkey-G · 2026-01-27
74.7%