Description
When a tool call returns isError: true, the error text is forwarded to the user as part of the assistant's reply. This exposes internal tool errors (stack traces, permission errors, etc.) that should stay in the agent's context for self-correction, not be shown to the user.
Current behavior
Tool result with isError: true → included in outbound payload filter → sent to user as message text.
Expected behavior
Filter out isError payloads from user-facing messages. The agent already sees the error in its context and can decide how to communicate it.
Suggested fix
In the payload filter (reply handler), add:
if (p.isError) return false;
This is a single line addition to the payload filtering pipeline.
Description
When a tool call returns
isError: true, the error text is forwarded to the user as part of the assistant's reply. This exposes internal tool errors (stack traces, permission errors, etc.) that should stay in the agent's context for self-correction, not be shown to the user.Current behavior
Tool result with
isError: true→ included in outbound payload filter → sent to user as message text.Expected behavior
Filter out
isErrorpayloads from user-facing messages. The agent already sees the error in its context and can decide how to communicate it.Suggested fix
In the payload filter (reply handler), add:
This is a single line addition to the payload filtering pipeline.