Repository navigation
Conversation
Ships omarchy-agent-usage-opencode-go, a new agent-usage collector that appears automatically in the agents widget (the update command globs omarchy-agent-usage-* and the panel picks up any record that lands in the usage directory). Local stats come from the opencode session database, filtered to the opencode-go provider; usage windows (rolling 5h, weekly, monthly) come from OpenCode's public Zen API using the key stored in opencode's auth store.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds OpenCode Go usage and subscription-limit collection to the Agents panel.
Changes:
- Adds local SQLite usage scanning and Zen API limit collection.
- Adds scanner and cache-recovery tests.
- Documents the new provider and credentials.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-agent-usage-opencode-go |
Implements the collector, caching, authentication, and API integration. |
test/shell.d/agent-usage-opencode-go-scanner-test.sh |
Tests local scanning and cache recovery. |
shell/plugins/agents/README.md |
Documents OpenCode Go support and configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kczimm
added a commit
to kczimm/omarchy
that referenced
this pull request
Aug 28, 2026
Adds native support for OpenCode Go subscriptions in the agents panel. Queries OpenCode's official /zen/go/v1/usage API for rolling (5h), weekly, and monthly limit usage with reset timers. Unique features compared to other PRs (omacom#7157, omacom#8065, omacom#6526, omacom#6779, omacom#6464): - Pi session scanning for local token stats - Harness-agnostic key discovery (Pi, OpenCode CLI, env var) - Account-scoped metadata (scope, hasPromptStats) Key design decisions: - Uses curl instead of urllib to bypass Cloudflare TLS fingerprinting - Includes light/dark icon variants matching OpenCode brand colors - Adds test coverage for auth lookup, API parsing, and error handling
This was referenced Sep 20, 2026
Contributor
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
omarchy-agent-usage-opencode-go, a new agent-usage collector for the OpenCode Go subscription, so the built-in Agents bar panel can show it alongside Claude Code, Codex and Fireworks.No widget code changes are needed: the updater globs
omarchy-agent-usage-*and the panel displays any record that lands in the usage directory, per the plugin's own contract.What it does
~/.local/share/opencode/opencode.dbfor assistant messages routed through theopencode-goprovider (samejson_extractacceleration + exact-match filter used by the codex collector), counting input / output / reasoning / cache tokens per model and per day.GET https://opencode.ai/zen/go/v1/usage(rolling 5h, weekly, monthly windows, percent used + reset time) using the key opencode stores in~/.local/share/opencode/auth.json(opencode-goentry) orOPENCODE_API_KEY.omarchy:*headers, versioned cache envelope withscanDate,--force/--limits-only, graceful fallback to local stats when unsigned or the endpoint is unreachable.Tests
Adds
test/shell.d/agent-usage-opencode-go-scanner-test.shcovering:opencode-goVerified locally against a real opencode DB + live API.
Docs
Adds a row to the Agents plugin README collector table plus a note on where OpenCode Go reads its credentials.