Description
When using the exec tool to run PowerShell commands on Windows, if the command output contains binary content (e.g., Python stdout with a UTF-8 BOM), the Gateway renders the response as "see in attachment" instead of showing the actual output text.
This breaks the agent's ability to read and process command output directly in context.
Steps to Reproduce
- Run OpenClaw Gateway on Windows (Node 24.x)
- Execute any PowerShell command via the
exec tool that produces output containing a binary BOM
- The tool response shows "see in attachment" rather than the plain text
Example:
python -c "print('hello')"
Current Workaround
Appending | ForEach-Object ToString to every PowerShell command:
python -c "print('hello')" | ForEach-Object ToString
But this is fragile, easy to forget, and must be applied to every exec call.
Expected Behavior
The exec tool should handle binary content or BOM-prefixed text output gracefully -- either stripping the BOM and rendering as text, or providing a configuration option to control the text vs. attachment threshold.
Environment
- OS: Windows 10/11 (64-bit)
- OpenClaw: latest (2026.7.x)
- Node: v24.x
- Shell: PowerShell
- Python: 3.13+
Additional Context
Only occurs on Windows with PowerShell. Linux/macOS shells do not exhibit this behavior since they do not emit BOM bytes before stdout text output.
Description
When using the
exectool to run PowerShell commands on Windows, if the command output contains binary content (e.g., Python stdout with a UTF-8 BOM), the Gateway renders the response as "see in attachment" instead of showing the actual output text.This breaks the agent's ability to read and process command output directly in context.
Steps to Reproduce
exectool that produces output containing a binary BOMExample:
Current Workaround
Appending
| ForEach-Object ToStringto every PowerShell command:But this is fragile, easy to forget, and must be applied to every exec call.
Expected Behavior
The exec tool should handle binary content or BOM-prefixed text output gracefully -- either stripping the BOM and rendering as text, or providing a configuration option to control the text vs. attachment threshold.
Environment
Additional Context
Only occurs on Windows with PowerShell. Linux/macOS shells do not exhibit this behavior since they do not emit BOM bytes before stdout text output.