Skip to content

fix: count read_file lines without loading the whole file - #57

Merged
SoryAK merged 1 commit into
mainfrom
fix/stream-line-count
Sep 21, 2026
Merged

SoryAK merged 1 commit into
mainfrom
fix/stream-line-count

Conversation

@SoryAK

@SoryAK SoryAK commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • The read clamp / past-EOF breaker only needs a line count. It now scans the file in 64 KiB chunks instead of readFileSync of the whole target, so a large log cannot balloon daemon RAM.
  • The reported count is unchanged (newline bytes + 1, including a trailing newline).

Test plan

  • packages/core/src/bcb/context.test.ts plus breaker/intervention tests
  • CI test required check

Made with Cursor

The breaker only needs a line count. Scan 64 KiB at a time instead of
readFileSync of the entire target, so a large log cannot balloon daemon RAM.
@SoryAK
SoryAK merged commit 9411aff into main Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant