Repository navigation
claude: establish local history coverage after a complete scan - #12
Conversation
The Claude cost scan never set history_coverage_established, so callers that only trust complete history (VibeTV Companion on Windows) dropped Claude's token history. A finished, non-cancelled walk over an existing projects folder without read errors now establishes coverage; knownZero only for such a scan without usage. VibeTV DreamyTalesPAN/CodexBar-Display#820.
|
@codex review |
|
Tested as This repository has no Codex review connector (no answer to |
|
@marcus7989 Tested in DreamyTalesPAN/CodexBar-Display#824 on the Windows bench: with |
Win-CodexBar never marks Claude's local token history as complete, so the VibeTV Control Center on Windows always shows "Token history is unavailable" for Claude, even though
cost --jsonreturns real Claude daily tokens (VibeTV issue DreamyTalesPAN/CodexBar-Display#820, reported by a customer).Cause:
scan_claude_with_cancelstarts fromCostSummary::default()and never setshistory_coverage_established; only the Codex scan sets it. The Companion only trusts a daily series when that flag is true (so padded zeroes never show as real usage), so Claude history is dropped on every Windows machine.Change (only
rust/src/cost_scanner.rs+ tests): the Claude scan now establishes coverage when the projects folder exists, the walk was not cancelled, and every folder, file timestamp and file could be read.knownZerois set only for such a complete scan that found no usage (after the pi-compatible rows are added). A missing folder, a cancelled scan or a read error keeps coverage unestablished, as before. This follows upstream main (claude_scan.rsfinalize_claude_summary), without its malformed-line and incomplete-request tracking.cli/cost.rsis unchanged (no overlap with #11).Tests: 5 new unit tests (usage → coverage, empty → known zero, missing folder, cancelled scan, read error).
cargo test --lib cost_scanner75/75 on macOS. The 4 macOS-only path test failures and the clippy findings under local Rust 1.91 are identical on the based22db28c; the Windows PR check is the gate.Released as pre-release
v0.60.3-vibetv.12from this head for the VibeTV pin; the merge stays with the reviewer.