v0.7.4 — peer_context_status undercount fix
[0.7.4] — 2026-06-30
Fixed — peer_context_status undercount for fresh / post-clear sessions
peer_context_status significantly undercounted token usage for sessions that had recently gone through cache invalidation (after /clear, autocompact, or session start), in some cases reporting a few percent when the real figure was over 80%.
- Root cause: v0.7.0–v0.7.3 read
cache_read_input_tokensalone. That works for mature cached sessions wherecache_readdominates, but in a freshly filling cache most input lands incache_creation_input_tokenswhilecache_readis tiny, so the reported percentage collapsed toward zero. - Fix:
tokensUsed = cache_read + cache_creation + input + output— the total tokens in the context window after the last assistant turn. This matches/contextacross both fresh and mature sessions.
Tests
- 263 → 265 (+2 covering the full-formula sum and missing-field handling).