feat(opencode-go): add OpenCode Go plugin with tracking and limits#270
feat(opencode-go): add OpenCode Go plugin with tracking and limits#270praveenjuge wants to merge 3 commits intorobinebers:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR adds a new "OpenCode Go" plugin that tracks local AI coding spend against published plan limits by reading from OpenCode's local SQLite database. Linked to issue #170 (which describes broader OpenCode integration), this PR focuses specifically on the Go plan with a local-history approach rather than the cookie-based dashboard parsing proposed in the issue.
Changes:
- New plugin (
plugin.js,plugin.json,icon.svg) that reads OpenCode's local SQLite database and auth file to compute rolling 5-hour, weekly, and monthly usage as percentages of published dollar limits ($12/$30/$60) - Comprehensive test suite covering detection, time-window aggregation, clamping, and graceful degradation on database failures
- Provider documentation and README entry for OpenCode Go
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/opencode-go/plugin.js | Core plugin logic: auth detection, SQLite history queries, time-window aggregation (5h rolling, weekly UTC Monday, anchored monthly), and progress line building |
| plugins/opencode-go/plugin.json | Plugin manifest with metadata, brand color, links, and line layout definition |
| plugins/opencode-go/plugin.test.js | Tests for detection, time-window calculations, edge cases, clamping, and soft fallback on DB errors |
| plugins/opencode-go/icon.svg | OpenCode logo SVG icon |
| docs/providers/opencode-go.md | Provider documentation covering detection, data source, limits, window rules, and failure behavior |
| README.md | Adds OpenCode Go to the supported providers list in alphabetical order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22a1719e36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Description
Adds a new plugin for OpenCode Go that tracks local spend against published plan limits.
Related Issue
#170
Type of Change
Testing
bun run buildand it succeededbun run testand all tests passbun tauri devScreenshots
Checklist
mainbranchSummary by cubic
Adds the
opencode-goprovider plugin to track local spend and show progress against 5h, weekly, and monthly limits. Fulfills #170.New Features
~/.local/share/opencode/auth.jsonkey or existing local history; hidden otherwise.~/.local/share/opencode/opencode.dbto sum assistant message cost; no cross-device or remote estimates.docs/providers/opencode-go.md), README entry, and tests.Bug Fixes
Written for commit 933ff2c. Summary will update on new commits.