Commit graph

2 commits

Author SHA1 Message Date
iamtoruk
8e39a89fe0 fix: pricing accuracy, stream leak, CSV injection hardening
- Remove bidirectional fuzzy match in getModelCosts that could return
  wrong pricing when a short canonical name prefix-matched a longer key
- Use explicit undefined check in parseLiteLLMEntry so free models with
  zero cost are not silently dropped from the LiteLLM pricing database
- Destroy read stream in finally block of readSessionLines to prevent
  file descriptor leaks when the generator is abandoned early
- Extend CSV injection escaping to cover tab and carriage-return prefixes
- Add optional chaining fallback for empty periods in exportCsv/exportJson
- Add regression tests for all fixes (models, export, fs-utils)
2026-04-21 04:20:46 -07:00
Ninym
0ab66f6fe9 test(fs-utils): add failing test for bounded read helper
Tests the to-be-built readSessionFile helper: under-cap fast path,
at-threshold stream path, over-cap null+skip, verbose stderr warning,
and stat-failure graceful fallback. Fails against missing module --
Task 5 will implement src/fs-utils.ts to flip GREEN.
2026-04-17 08:32:18 +02:00