feat minor daemon feat/phase-2g-bundle
AI Agent git-import/068377df · 113 days ago · Apr 5, 2026 · Diff

feat(daemon): Session 9 — cost tracking and daily guardrails (Daemon Spec Phase F)

Add token estimation, daily cost accumulation in daemon-cost.json (UTC-date keyed, auto-resets each calendar day), and configurable max_cost_per_day_usd cap enforcement. The daemon skips consolidation passes when the cap is met but stays alive. getDaemonStatus now surfaces cost_today_usd and cost_cap_usd.

New files: lib/daemon-cost.mjs — estimateTokens, computeCallCost, getDailyCost, recordCallCost, resetDailyCost test/daemon-cost.test.mjs — 46 unit tests

Modified: lib/daemon.mjs — trackedLlmFn wrapper, cost-cap guard in loop, cost fields in getDaemonStatus test/daemon.test.mjs — 18 integration tests (Phase F: Cost Guards), 1 updated test (wrapper semantics)

949 tests passing, 0 failing (59 new tests, 890 baseline preserved).

sha256:206a58cf2d6f133cad70fc717cb4effba7ff3a32d8cf6b02f501a8bedc32aaad sha
sha256:38742f5a7d0ba55bcc8fab41d02e18327d72247c09e529bb3729e14ec8ce42a8 snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:206a58cf2d6f133cad70fc717cb4effba7ff3a32d8cf6b02f501a8bedc32aaad --body "your comment"