mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:10:45 +00:00
fix(gateway): skip oversized JSONL lines to prevent event-loop starvation
Large transcript JSONL records (multi-MB tool results, file content) block the event loop via JSON.parse before truncation logic can skip them. Add a 256 KiB line-size guard to parseTailTranscriptRecord and extractUsageSnapshotFromTranscriptLine, and replace the full transcript index scan in readSessionTitleFieldsFromTranscriptAsync with the existing bounded sync reader. Observed improvement on a production install (33 sessions): chat.history dropped from 13-16s to ~1.2s, event loop utilization from 0.999 to normal, steady-state CPU from ~100% to 0.2-0.3%. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Vincent Koc
parent
d122a3492d
commit
4c9a557533