Repository navigation
fix(pm/aggregator): name quota pools by their OpenCode config provider ids - #5059
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
…r ids meta:high-usage -> meta, openai:codex -> openai, opencode-go:drewrypope -> opencode-go.drewrypope, opencode-go:popesdrew -> opencode-go.popesdrew, cline-pass:cline-pass -> cline-pass, opendesign:go -> opendesign, deepseek:api -> deepseek, commandcode:go -> commandcode; openai.alternate already matched. Rebased onto Part 2 (8f9cb79, Go accounts renamed Personal/Lab -> drewrypope/popesdrew in the config itself), so the Go dot forms follow the current config names. anthropic:claude-pro and the antigravity:* splits keep colon ids (no config provider carries their names). Snapshot series: renamed pools start new series under the config names; historical series and the one-shot backfill seed keep the old ids unrewritten. Full aggregator suite: 1376 pass, 0 fail (re-verified after rebase).
54d6b15 to
c604fba
Compare
Quota pool ids: align with the OpenCode config provider ids (Drew, 2026-11-03)
The /quota board named its pools with colon-suffixed ids that exist nowhere in the deployed OpenCode config (
.opencode/opencode.jsonc"provider" block + runtime overlay). This PR renames every live pool/service id to the exact config provider id, in one pass across all consumers:POOL_SPECS/FILTER_EXEMPT_POOL_IDS(quota-extract.ts),serviceIdFor()+ the Go split ids (quota-gather-map.ts), the §4 snapshot record writers (snapshot-records.ts), burn attributionpoolFor()(scripts/collect-fleet-feed.ts), the DeepSeek PAYG history key (render.ts), and every test that pins these ids. The ClinePass native adapter and the file-export mapper derive their serviceId fromserviceIdFor(), so they follow automatically.Mapping (old → new)
meta:high-usagemetameta("Meta Model API")openai:codexopenaiopenai— the main account; its Codex window is what this pool measures. Plan label stays "ChatGPT (Codex pool)"openai.alternateopenai.alternateopencode-go:drewrypopeopencode-go.drewrypopeopencode-go.drewrypope("OpenCode Go (drewrypope)") — see the Part 2 note belowopencode-go:popesdrewopencode-go.popesdrewopencode-go.popesdrew("OpenCode Go (popesdrew)") — see the Part 2 note belowcline-pass:cline-passcline-passcline-pass("ClinePass")opendesign:goopendesignopendesign("Open Design"); plan label stays "Go"deepseek:apideepseekdeepseek— same rename logic, non-displayed spec (shell pool, door currently disabled)commandcode:gocommandcodecommandcode— same rename logic, non-displayed spec (currently filtered: provider disabled)Display provider/plan labels were already the config names ("Meta Model API", "ClinePass", "Open Design", …) and are unchanged; no label contradicts its new id.
The Go dot forms carry end-to-end — no exception needed
opencode-go.drewrypope/opencode-go.popesdrewwork as pool ids through every mechanism that made the colon form look load-bearing:overlayQuotaCurrentkeys pools by entryserviceId— an opaque string match, dot-safe.GO_DREWRYPOPE_SERVICE_ID/GO_POPESDREW_SERVICE_IDnow emit the dot ids; the combined bareopencode-gorows (one per workspace credential) are untouched and keep working for existing consumers. The gatherer's per-account provider rows already used dot ids via theserviceIdFordefault.poolProviderId()splits on:only, so a dot id's door is the full config provider id itself — exact-match filtering semantics unchanged (disablingopencodestill does not filter the Go pools; the pinned test covers this).Part 2 landed mid-flight — this PR composes with it
While this PR was in flight, Drew's Part 2 commit
8f9cb79b3("rename Go accounts to owner names") landed directly on main: the config providers formerly namedopencode-go.personal/opencode-go.labare nowopencode-go.drewrypope/opencode-go.popesdrew, and main's pool ids becameopencode-go:drewrypope/opencode-go:popesdrewwith credential labels to match. This PR was rebased onto that commit and follows the current config: the Go pools take the dot forms of the owner names. Thesrc/sources/fixtures.tsGo/deepseek ids, which Part 2 itself updated to mirrorPOOL_SPECS, follow to the dot forms here.Exceptions (kept colon ids, with reasons)
anthropic:claude-pro— the config defines noanthropicorclaude-proprovider; the pool is burned throughclaude-code. Renaming it toclaude-codewould name a pool after a door and collide with the credential-source vocabulary; it is not one of the board's displayed pools today.antigravity:gemini/antigravity:claude-gpt— no config provider carries either name; the pools are burned throughantigravity-ls/antigravity-agy/googlejointly. The config'santigravity-directis a different door, so renaming would misattribute the pools.src/sources/fixtures.ts— synthetic demo data (it also containsanthropic:claude-subscription,meta:model-api, …) whose invented ids are not live pool identity, left as-is.Snapshot-series decision: rename going forward, do NOT rewrite history
serviceIdFor()feeds the §4 snapshot records, so each renamed pool starts a new snapshot series under its config name with the next moved reading. The pre-rename series stays in the store under the old colon id, unrewritten — it is the honest record of what the pool was called when those points were observed.scripts/backfill-usage-snapshots.ts(one-shot historical seed for 2026-10-20..25 observations) therefore keeps the old ids verbatim, with a header note saying why; re-running it can never fork a historical point into the new series. Consequence: per-pool history graphs show a series break at the rename, which is visible and truthful rather than silently spliced.Tests
Full aggregator suite on the laptop: 1376 pass, 0 fail across 99 files (bun test, laptop), re-verified after the rebase onto Part 2 (
8f9cb79b3). Typecheck: one pre-existing error in test/overview.test.ts (HealthView conflicts) also present on unmodified main; no new type errors.. (Updated in place: quota.test, quota-current.test, quota-gather-map.test, clinepass-adapter.test, token-adapter.test, snapshot-writers.test, usage.test.)Deploy + live verification
After merge: the primary checkout (
~/git/code, the aggregator + gatherer WorkingDirectory) is fast-forwarded to the merge,pm-aggregator.serviceis restarted, the quota gatherer is run, andGET /api/quota.jsonis compared pool-by-pool against the pre-rename read — same 7 pools, same windows/states/freshness, under the new ids.