You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(cli): ingesting one call rewrites its whole month #1001
Ingesting one call rewrites its whole month partition of the usage ledger (usage-ledger-adapter.ts). At 265k records that takes about 3 s, measured for #993. It runs in the async catch-up hook, so no session waits, but the cost grows with the month.
Scope
Make an ingest cost what it adds, not the size of its month.
Keep what the rewrite guarantees today: one record per call (message.id:requestId, per tool), the largest total wins, written under the lock and only when content changes.
Activity
blafourcade commentedon Oct 15, 2026
Fixed by #1031 (fcb6022 on next): the ledger is partitioned by day, so one ingest reads and rewrites about three days instead of the whole month.