mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-21 03:39:54 +00:00
921133cfa5
Adapt the byte-boundary-safe truncation fix from PR #14040 by taosiyuan163 into the new _capture_log_snapshot() code path: when the truncation cut lands exactly on a line boundary, keep the first retained line instead of unconditionally dropping it. Also add a 2x max_bytes safety cap to the backward-reading loop to prevent unbounded memory consumption when log files contain very long lines (e.g. JSON blobs) with few newlines. Based on #14040 by @taosiyuan163.