codeburn/src
iamtoruk 8ab9ea916b Add per-file result cache for Codex provider
Fixes #183. Users with large Codex session directories (45 GB, 10K+
files) experienced CPU pegging because every 30-second refresh re-parsed
all session files from scratch.

Three optimizations:

1. readFirstLine now reads 16 KB via fs.open() instead of loading the
   entire file through readSessionFile. Cuts discovery I/O from ~45 GB
   to ~160 MB for 10K files.

2. Per-file result cache (codex-results.json) with mtime+size
   fingerprinting. Parsed results are cached on first run; subsequent
   runs return cached data instantly for unchanged files.

3. Cache-accelerated discovery skips header validation for cached files,
   pulling the project name directly from the cache manifest.

Cache safety: fingerprint captured before read (no TOCTOU), atomic
write via temp+fsync+rename, 0o600 permissions, Object.hasOwn for
prototype pollution defense, eviction of deleted files on flush,
try/finally ensures flush even on parse errors.
2026-04-30 16:43:41 -07:00
..
data Add Qwen provider and replace hardcoded pricing with LiteLLM snapshot 2026-04-28 19:49:14 +02:00
providers Add per-file result cache for Codex provider 2026-04-30 16:43:41 -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 Fix review findings: error handling, constant dedup, migration persist 2026-04-28 22:56:47 +02:00
codex-cache.ts Add per-file result cache for Codex provider 2026-04-30 16:43:41 -07:00
compare-stats.ts feat(compare): model comparison with planning rate fix 2026-04-19 08:34:49 -07:00
compare.tsx Fix compare chart bar colors to always match legend 2026-04-24 20:18:33 +02:00
config.ts Add claude-max-5x preset for $100/month tier 2026-04-24 15:47:59 +02: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 Add new providers, fix menubar tabs, accent color picker (#167) 2026-04-27 19:46:30 -07:00
daily-cache.ts Fix review findings: error handling, constant dedup, migration persist 2026-04-28 22:56:47 +02: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 Make daily cache durable: hydrate from all commands, migrate instead of nuke 2026-04-28 22:41:01 +02:00
optimize.ts fix: switch scanJsonlFile and parseSessionFile to readSessionLines to prevent OOM 2026-04-22 10:11:13 +00:00
parser.ts Add per-file result cache for Codex provider 2026-04-30 16:43:41 -07: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 Add claude-max-5x preset for $100/month tier 2026-04-24 15:47:59 +02: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
yield.ts chore: clean up yield.ts - remove redundant comments and dead code 2026-04-25 14:04:16 +02:00