Repository navigation
agents: add OpenCode usage collector - #9944
Closed
ranjithrajv wants to merge 1 commit into
Closed
ranjithrajv wants to merge 1 commit into
ranjithrajv wants to merge 1 commit into
Conversation
Add omarchy-agent-usage-opencode to surface OpenCode sessions in the agents bar panel alongside Claude, Codex, and Fireworks. The collector reads ~/.local/share/opencode/opencode.db directly (all providers), groups tokens by day and model, and writes the same schemaVersion 1 record the panel already watches. Update the agents manifest defaults and README to include the new provider.
ranjithrajv
force-pushed
the
feat/agents-opencode
branch
from
September 8, 2026 05:11
17ca1c1 to
0db4cea
Compare
Member
|
Automated duplication check: this pull request looks similar to #8065, which covers the same OpenCode usage collector. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
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
Adds an
omarchy-agent-usage-opencodecollector so theomarchy.agentsbar panel shows OpenCode usage alongside Claude, Codex, and Fireworks.~/.local/share/opencode/opencode.db(any provider) — input/output/reasoning/cache tokens, grouped by day and model.schemaVersion: 1,--force/--limits-only, file-locked cache in~/.cache/omarchy/agent-usage,ready/hasLocalStatsbased on actual sessions).limits: [], same as other local-only views.opencode(enabled by default,enabledstill defaults totruefor any discovered agent).Automatically discovered by
omarchy-agent-usage-update(ships asbin/omarchy-agent-usage-opencode) — no plugin code changes needed.Testing
python3 -m py_compile bin/omarchy-agent-usage-opencode— passbin/omarchy-agent-usage-opencode --force | jq— produces valid record withid: opencode,recentDays,modelUsage,todayTokensByModelomarchy-agent-usage-update --force && ls ~/.local/state/omarchy/agents/usage/—opencode.jsonappears and the bar panel picks up a new tab on refreshNotes
XDG_DATA_HOMEfor the DB path; read-only SQLite open to avoid blocking a running opencode.