Skip to content

feat: complete OpenCode Go CPA quota and catalog integration - #13

Closed
williamxhero wants to merge 10 commits into
massiveits:mainfrom
williamxhero:codex/opencode-go-online-sync
Closed

williamxhero wants to merge 10 commits into
massiveits:mainfrom
williamxhero:codex/opencode-go-online-sync

Conversation

@williamxhero

Copy link
Copy Markdown

Summary

This PR completes the OpenCode Go CPA plugin integration for current CLIProxyAPI hosts and the legacy Management Center compatibility surface.

Changes

  • keep the native OpenCode Go quota provider and model catalog integration in sync with the current CPA host API
  • restore the legacy quota resource page and compatibility quota endpoint
  • return the legacy credential list in the { "cards": [...] } shape expected by older Management Center builds
  • add quota coverage for the rolling 5-hour, weekly, and monthly windows
  • include the muse-spark-1.3-contributor-free catalog entry and route Space Bunny models correctly
  • preserve bounded credential lookup and readable generated OpenCode Go account identities

Validation

  • C:\Program Files\Go\bin\go.exe test ./...
  • C:\Program Files\Go\bin\go.exe vet ./...

Both commands pass.

darfink and others added 10 commits September 30, 2026 11:27
Advertise the quota_provider capability and serve quota.identifier,
quota.describe, and quota.fetch so CLIProxyAPI v7.2.159+ (including v8)
reports OpenCode Go credentials as quota-capable and serves their
rolling, weekly, and monthly windows through /v0/management/quota/fetch.

The quota RPC method names and wire shapes are declared locally, so the
SDK stays on v7.2.138 and the plugin keeps reporting schema version 3.
Older hosts ignore the unknown capability and keep loading the plugin.
The separate quota page stays for hosts and Management Center builds
without generic plugin quota rendering.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Cap quota upstream lookups at 30 seconds for both the native provider
and the separate page, since the default request timeout is minutes
long. Assert schema version 3 literally and check the fetch wire keys,
so an SDK bump that breaks older hosts fails the tests. Add the native
quota provider to the release notes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OpenCode Go's rolling limit spans five hours. Reporting it as 5h lets
Management Center label and order it like other five-hour windows.
Document the v8 Management API quota route as well.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	README.md
#	RELEASE_NOTES.md
#	internal/plugin/plugin.go
#	internal/plugin/quota.go
@massiveits

Copy link
Copy Markdown
Owner

Thanks for the contribution. We’re planning to merge PR #10 at the end of this week, and PR #13’s quota changes overlap with it.

Please split the catalog/model-routing changes from the quota and legacy Management Center compatibility work. CONTRIBUTING.md says:

“Focused Scope: Keep each PR targeted to a single fix or feature. Avoid bundling unrelated refactors or features together.” (line 36)

Also, please remove the space-bunny prefix from internal/catalog/catalog.go. Space Bunny is not a permanent model family, so it should be routed through the existing route-overrides configuration rather than added to the built-in prefix list. That avoids growing the prefix list for temporary model families and having to remove them later.

We’re updating the plugin to CLIProxyAPI v8, so we don’t need to preserve CLIProxyAPI v7 compatibility in this work. Please avoid adding compatibility code or documentation for v7.

Please run go test -tags debug ./..., as required by CONTRIBUTING.md:

“Debug-Mode Verification: Verify all changes using -tags debug.” (line 37)

The PR reports go test ./... and go vet ./..., but not the required debug-tag test command. We can review the remaining changes after PR #10 is merged.

@massiveits massiveits closed this Oct 5, 2026
@williamxhero
williamxhero deleted the codex/opencode-go-online-sync branch October 7, 2026 12:45
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.

4 participants