Files
openclaw/src
lsr911 2cd831a0e3 fix(agents): use Buffer.byteLength for bash output rolling buffer accounting (#103272)
* fix(agents): use Buffer.byteLength for bash output rolling buffer accounting

The outputBytes variable tracks the rolling output buffer size for
bash command execution, but it used string .length (UTF-16 code units)
instead of Buffer.byteLength (UTF-8 bytes). When command output
contains multi-byte UTF-8 characters (emoji, CJK, etc.), the .length
undercount causes the rolling buffer to exceed maxOutputBytes.

Replace .length with Buffer.byteLength() at both increment and
decrement sites to correctly track byte-level buffer size.

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(agents): unify bash output accumulation

* refactor(agents): unify bash output accumulation

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <peter@steipete.me>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-10 06:41:50 +01:00
..