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
Commit e4ad1d9
Browse filesBrowse the repository at this point in the historyBrowse files
Subscription mode (claude-code / codex) already received cost_usd from
caw, but each call overwrote backend.last_usage and only the incremental
updater read it, so a full generate never reported what it cost.
- UsageLedger (backend.py) records one entry per CLI process / agent
run, with phase, kind, target, model, seconds, tokens and cost. It is
thread-safe for caw's MCP worker threads. Nested caw sub-module agents
record themselves, so totals add up without double counting.
- Both backends route usage through LLMBackend._record_usage, which
still sets last_usage for the updater.
- Phases: clustering, modules, parent_modules, overview, update.
- metadata.json gets a "usage" block (totals, by_phase,
unpriced_models, calls) and generation_info.provider.
- `codewiki generate` prints tokens and the estimated cost, notes that
subscription cost is API-equivalent, and flags models with tokens but
no price instead of showing $0.
0 commit comments