feat: collect OpenCode usage as a fourth local tool source - #6
Merged
Conversation
OpenCode's own Claude/GPT model usage was previously invisible: the oneapi collector excludes any request whose model name matches the Claude/Codex family (assuming it's already covered by the Claude Code / Codex CLI collectors), but ccusage never reads OpenCode's local records, so that usage disappeared entirely. Add opencode as a first-class local tool alongside codex/claude, collected via 'ccusage opencode daily --json', sharing claude's cache_create/cache_read field shape. Bump schema/model-breakdown version since new opencode_* fields are added to persisted fragments and usage.json.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opencodeas a fourth first-class local tool alongside codex/claude/cursor, collected viaccusage opencode daily --json, sharing Claude's cache_create/cache_read field shape.opencode_*fields are added to persisted machine fragments and usage.json.Testing
node --test tests/*.test.mjs: 80/80 pass (updated 2 fixtures with hardcoded 4-tool lists).python3 -m unitteston daily reconciliation / oneapi / ccusage-pricing / codex-jsonl suites: all pass except one pre-existing unrelated failure (test_positive_model_remainder_is_labeled_legacy_unknown), reproduced identically on the base branch.