Files
openchamber/packages/ui
JSup 22e227b6fd fix(ui): cap oversized tool output before rendering to prevent renderer OOM
A tool that returns oversized external content (e.g. a fetched web page
with full-resolution base64 images inlined) previously flowed through the
tool-output rendering path as a single unbounded JS string: it was
JSON.parsed, syntax highlighted, and attached to the DOM with no size
check at any stage. A large enough single string exceeds V8's Zone
allocator and hard-crashes the renderer process with
"Zone Allocation failed" (issue #2265); the existing 1200-line highlight
limit, 80-line virtualization threshold, and max-height CSS clip are all
downstream of the allocation and do not prevent it.

Add a bounded size guard (capToolOutputText / TOOL_OUTPUT_MAX_CHARS) and
apply it at getToolOutputText, the single funnel every generic tool-output
string passes through before JSON.parse / highlighting / DOM work. Output
under the cap is unchanged; oversized output keeps a useful head and gets
a visible truncation notice instead of crashing the renderer.

Signed-off-by: JSup <hanjisang0914@gmail.com>
2026-07-23 02:59:04 +09:00
..
2026-07-22 18:14:11 +03:00