Skip to content

feat(opencode): add OpenCode Go quota tracking provider#109

Open
hiyukoim wants to merge 3 commits into
onllm-dev:mainfrom
hiyukoim:feat/opencode-provider-v2
Open

feat(opencode): add OpenCode Go quota tracking provider#109
hiyukoim wants to merge 3 commits into
onllm-dev:mainfrom
hiyukoim:feat/opencode-provider-v2

Conversation

@hiyukoim

Copy link
Copy Markdown

Summary

Replaces closed #102 since it got messy. Rebuilds OpenCode Go as a quota provider on current upstream/main (keeps Kimi / Moonshot / DeepSeek), following the existing provider pattern from CONTRIBUTING.md. Related: #100.

  • Agent + tracker + SQLite store for OpenCode Go snapshots (5-hour / weekly / monthly)
  • Dashboard tab, charts, deep insights, menubar card, settings UI
  • Config via OPENCODE_GO_WORKSPACE_ID + OPENCODE_GO_AUTH_COOKIE (see docs/OPENCODE_SETUP.md)
  • OPENCODE_ENABLED remains the separate Codex-via-OpenCode-auth path
  • Frontend contract: quota JSON uses limit (not limitValue); empty-state re-render guarded; dedicated history routing

Why a new PR

#102 was closed after an unrelated-histories merge onto the harden branch corrupted history / app.js. This branch starts clean from upstream/main and ports OpenCode-only changes.

Provider checklist

Per CONTRIBUTING "Adding a New Provider":

  1. internal/api/opencode*.go
  2. internal/store/opencode_store.go (+ schema in store.go)
  3. internal/tracker/opencode_tracker.go
  4. internal/agent/opencode_agent.go
  5. Endpoints in internal/web/handlers.go / opencode_handlers.go
  6. Dashboard tab + charts in internal/web/static/app.js

Test plan

  • Focused short tests: api, web, agent, store, tracker, config
  • go vet ./...
  • CI green on this PR
  • With OPENCODE_GO_WORKSPACE_ID + OPENCODE_GO_AUTH_COOKIE set: OpenCode tab appears, quotas poll, charts update
  • Without OpenCode env: other providers unchanged, no OpenCode tab noise
./app.sh --smoke
# optional full suite:
./app.sh --test

hiyukoim and others added 3 commits July 24, 2026 12:29
Rebuild PR work cleanly from upstream (keeps kimi/moonshot/deepseek).
Hardened scrape client, tracker wiring, typed errors, dashboard/UI,
limit-field contract test, and empty-state/history frontend fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent DetectCodexCredentials from reading the host OpenCode
auth.json when CODEX_HOME auth is empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pin OPENCODE_HOME to a temp dir in tests so host auth.json
cannot leak on macOS. Add menubar/tab/historyBoth/settings
and document OPENCODE_GO_* in .env.example.
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