Skip to content

feat: collect OpenCode usage as a fourth local tool source - #6

Merged
BrickerP merged 1 commit into
mainfrom
codex/run-the-archive
Aug 11, 2026
Merged

feat: collect OpenCode usage as a fourth local tool source#6
BrickerP merged 1 commit into
mainfrom
codex/run-the-archive

Conversation

@BrickerP

Copy link
Copy Markdown
Owner

Summary

  • OpenCode's own Claude/GPT model usage was invisible in the report: 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 silently disappeared (neither counted under Claude Code nor under One API).
  • Adds opencode as a fourth first-class local tool alongside codex/claude/cursor, collected via ccusage opencode daily --json, sharing Claude's cache_create/cache_read field shape.
  • Bumps schema_version / model_breakdown_version to 4 since new opencode_* fields are added to persisted machine fragments and usage.json.
  • Updates frontend TOOLS/DailyRow types, README card generator, and legend layout (now dynamic to fit a 5th tool).

Testing

  • node --test tests/*.test.mjs: 80/80 pass (updated 2 fixtures with hardcoded 4-tool lists).
  • python3 -m unittest on 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.
  • No local build was run per project convention; CI/pipeline should compile.

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.
@BrickerP
BrickerP merged commit 7624c20 into main Aug 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant