singularity-forge/packages/pi-coding-agent
Mikael Hugo ccdd3027ab perf(read): stream lines when offset/limit provided to avoid loading entire file
When offset or limit are specified, use Node.js readline streaming instead of
loading the entire file into memory. This fixes the truncation issue for large
files (>50KB) where the read tool would return truncated content even when
requesting a small slice.

- Add readLinesStreamed() for memory-efficient line reading
- Add countLines() for total line count without full read
- Use streaming path when offset !== undefined || limit !== undefined
- Keep existing full-file read path when no offset/limit specified
- Add tests for streaming behavior with large files

Fixes the long-standing issue where reading large files like src/headless.ts
(~50KB) with offset/limit would still hit truncation limits.
2026-05-04 15:20:16 +02:00
..
scripts fix: handle Windows non-ASCII paths in cpSync with copyFileSync fallback (#1181) 2026-03-18 10:13:37 -06:00
src perf(read): stream lines when offset/limit provided to avoid loading entire file 2026-05-04 15:20:16 +02:00
package.json chore: CI workflows, package.json updates, test fixes, docs cleanup 2026-05-02 06:30:45 +02:00
tsconfig.json fix(gsd): align ADR-009 integration with type-safe builds 2026-04-14 20:46:46 -05:00