Skip to content

Quota probe for OpenCode Go is gated on the literal provider name, so additional Go providers (multi-account setups) show no quota #1924

Description

@0xtootoo29

Client or integration

OpenCodex dashboard

Area

Provider adapter

Summary

When multiple providers point at the canonical OpenCode Go base URL (https://opencode.ai/zen/go/v1) — the natural setup for balancing several Go subscriptions via combos — only the provider literally named opencode-go shows the rate-limit panel (5h / weekly / 30d). The sibling providers show no quota in the dashboard, and ocx provider quota --refresh --json returns no report rows for them. Expected: every key-auth provider on the canonical Go base URL reports quota.

Root cause: src/providers/quota.ts L2087 gates the probe on the provider name:

if ((provider.authMode ?? "key") === "key" && name === "opencode-go") {
  return fetchOpenCodeGoQuota(name, provider);
}

The Kimi branch just above (L2075) already uses the canonical-base-URL pattern instead, and fetchOpenCodeGoQuota itself re-validates isCanonicalOpenCodeGoBaseUrl(config.baseUrl) (L487), so the name check is both too narrow and redundant.

Proposed fix (verified locally on v2.14.0 — report rows went from 1 to 5, dashboard renders rate-limit bars for every sibling provider):

-    if ((provider.authMode ?? "key") === "key" && name === "opencode-go") {
+    if ((provider.authMode ?? "key") === "key" && isCanonicalOpenCodeGoBaseUrl(provider.baseUrl)) {
       return fetchOpenCodeGoQuota(name, provider);
     }

Safe against key leakage to non-canonical hosts because fetchOpenCodeGoQuota still checks the canonical URL before sending the bearer key.

Reproduction

  1. ocx provider add opencode-go --api-key sk-AAA (registry preset)
  2. ocx provider add opencode-go-2 --adapter openai-chat --base-url https://opencode.ai/zen/go/v1 --api-key sk-BBB
  3. ocx provider quota --refresh --json
  4. Only one "provider": "opencode-go" report is returned; the dashboard overview page for opencode-go-2 has no rate-limit section.

Version

v2.14.0 (repro); the gate is unchanged on current main as of 2026-08-17 (L2087)

Operating system

macOS (Darwin 25.5)

Provider and model

opencode-go (any model; the quota probe is model-independent)

Logs or error output

ocx provider quota --refresh --json before the fix returns a single opencode-go report row; after the one-line change it returns all five (opencode-go, opencode-go-2opencode-go-5), each with fiveHourPercent / weeklyPercent / monthlyPercent populated from https://opencode.ai/zen/go/v1/usage.

Screenshots and supporting files

No response

Redacted configuration

Providers: opencode-go (registry preset) plus opencode-go-2..5, all adapter: openai-chat, baseUrl: https://opencode.ai/zen/go/v1, authMode: key, one API key each. Keys redacted.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions