codeburn/src
Łukasz Majcher 5e49f17e64 fix: switch scanJsonlFile and parseSessionFile to readSessionLines to prevent OOM
readViaStream (used for files ≥8 MB) reconstructs the full file as a
single string via chunks.join('\n'), giving the same peak allocation as
readFile. Callers then call content.split('\n'), creating a second copy.
With FILE_READ_CONCURRENCY=16 and files up to 128 MB this can exhaust
the V8 heap (~6 GB theoretical peak).

readSessionLines already exists as a proper async generator that yields
one line at a time. Switch both hot-path callers to iterate it directly
so the full file string is never held in memory.

Adds two tests: a spy test confirming readSessionLines is called (not
readSessionFile), and a 500-entry correctness test.

Fixes #131
2026-04-22 10:11:13 +00:00
..
providers Merge main into feat/omp-support-model-aliases 2026-04-21 11:51:20 -07:00
bash-utils.ts feat: add Pi provider for tracking Pi agent sessions 2026-04-16 01:54:42 -07:00
classifier.ts chore: normalize Pi tool names via toolNameMap 2026-04-16 01:57:39 -07:00
cli-date.ts feat(report): add --from/--to date range filtering and avgCostPerSession (#80) 2026-04-18 15:11:33 -07:00
cli.ts Merge main into feat/omp-support-model-aliases 2026-04-21 11:51:20 -07:00
compare-stats.ts feat(compare): model comparison with planning rate fix 2026-04-19 08:34:49 -07:00
compare.tsx feat: add cache rebuild flag and progress 2026-04-21 00:03:49 +02:00
config.ts fix(config): restore catch-all in readConfig to prevent CLI crash on malformed config 2026-04-21 04:20:55 -07:00
context-budget.ts fix(context-budget): use bounded readSessionFile helper 2026-04-17 08:32:19 +02:00
currency.ts feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
cursor-cache.ts refactor: move providers onto shared cache metadata 2026-04-21 00:01:46 +02:00
daily-cache.ts Fix daily cache gap fill using UTC instead of local time 2026-04-19 04:23:17 -07:00
dashboard.tsx fix(plan): scope TUI plan row to billing period, use currency-aware formatting 2026-04-21 04:20:54 -07:00
day-aggregator.ts fix: use local timezone for daily date bucketing instead of UTC 2026-04-19 03:18:38 -07:00
export.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
format.ts fix: bucket turns by assistant timestamp, filter at turn level 2026-04-21 04:40:44 -07:00
fs-utils.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
menubar-installer.ts chore: point repo URLs at getagentseal org (#97) 2026-04-18 14:55:44 -07:00
menubar-json.ts feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
models.ts Merge main into feat/omp-support-model-aliases 2026-04-21 11:51:20 -07:00
optimize.ts fix: switch scanJsonlFile and parseSessionFile to readSessionLines to prevent OOM 2026-04-22 10:11:13 +00:00
parser.ts fix: switch scanJsonlFile and parseSessionFile to readSessionLines to prevent OOM 2026-04-22 10:11:13 +00:00
plan-usage.ts fix(plan): resolve type errors in plan summary and isActivePlan guard 2026-04-21 04:20:55 -07:00
plans.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
sqlite.ts fix(sqlite): load node:sqlite in ESM runtime 2026-04-19 05:27:05 +00:00
types.ts feat: multi-provider support (Codex + provider plugin system) 2026-04-14 04:32:09 -07:00