Repository navigation
Add OpenCode Go usage to Agents - #15153
Open
AlvaroMinarro wants to merge 3 commits into
Open
AlvaroMinarro wants to merge 3 commits into
AlvaroMinarro wants to merge 3 commits into
Conversation
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryAdds OpenCode Go to the Agents panel with account limits and machine-local token stats.
Reviews (3) · Last reviewed commit: "fix(agents): preserve OpenCode Go usage ..." · Reviewed by Greptile |
|
Thanks! Heads-up that #15089 ("agents: add Opencode usage collector and assets") and #14040 ("Add Cursor, OpenCode, Copilot, and Muse to the agents panel") also add OpenCode to the Agents panel. The maintainers will want to settle on one collector/provider id, so it's worth checking whether OpenCode Go can be a plan inside whichever OpenCode provider lands rather than a separate tab. |
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.
Add OpenCode Go usage to Agents
Adds OpenCode Go as a subscription tab in the existing Agents panel, with rolling 5-hour, weekly and monthly limits, the OpenCode mark, and daily/model token statistics. No new QML or panel behavior is required.
Changes
https://opencode.ai/zen/go/v1/usageusingOPENCODE_GO_API_KEYor OpenCode's savedopencode-gokey. Validate the response and keep credentials out of errors.Review path
Start with the collector's schema dispatch, cache validation and limits probe, then the two fixture-based tests. The tests isolate HOME/XDG paths, use synthetic SQLite/JSONL and mock HTTP; no live subscription is required. The mark follows the existing
assets/<provider-id>.svgconvention.Account switching, a new authentication flow, shared collector refactors and local systemd units are out of scope.
Verification
bash test/shell.d/agent-usage-update-test.sh.bash test/shell.d/agents-panel-test.sh../test/cliwith isolated HOME/XDG paths.git diff --check../test/cli(125 assertions) passed../test/shellfailed 9 of 448 test files; 44 files contained skips. Eight failures reproduce identically on the unchanged base (five require a display; the others areelsewhen-migration,i18n, andupdate-stay-awake-security).windows-vm-composefailed in the parallel suite but passes standalone on both base and candidate; that suite-dependent failure remains unresolved.The local prototype's tab, OpenCode mark and populated daily-token chart were visually confirmed. The upstream version's additional schema/cache hardening is covered by the isolated tests above; graphical acceptance tests have not been run against it.
Native review remains pending: the host has no model assigned to
review-risk; no reviewer ran and no verdict was submitted. This is not a review approval.Review fixes (44c6198)
PI_CODING_AGENT_DIRand include effective session roots in cache identity.Regression tests were observed failing before implementation and passing afterward. Independent verification found no candidate-caused regression, with the full-suite limitations above. Native review is still unavailable because no model is configured for
review-risk; no native reviewer ran or issued approval.