From 8dc7e75af7a19273674ff4e1c7adfd4aba83c6f1 Mon Sep 17 00:00:00 2001 From: repo-worker-code-g Date: Sat, 7 Nov 2026 08:08:52 -0600 Subject: [PATCH] providers: rename fleet-built providers to leading-underscore ids (#1823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drew ruling 2026-11-07 (opencode#1823): providers we custom-built carry a leading underscore; upstream providers keep their ids. Config: claude-code -> _claude, antigravity-direct -> _antigravity, vibe-direct -> _vibe, commandcode -> _commandcode, muse-direct -> _muse (provider blocks, route leaves, pool membership). meta, opendesign, cline-pass unchanged (upstream provider code / upstream SDK doors). A dated rename note tops the provider comments; older comments keep the pre-rename ids as history. pm-stack follows: POOL_SPECS ids _commandcode, _antigravity.gemini, _antigravity.claude-gpt (new snapshot series; old series stay); gather-map serviceIdFor + antigravity splits handle the new ids and keep the legacy ones for pre-rename reads; NON_POOL_SERVICE_IDS gains _antigravity; gatherer asks the quota registry for _commandcode (old spelling still resolves via fork aliases); collect-fleet-feed attributes _claude/_antigravity sessions; aa catalog gains the underscored keys. bin/sync-models + catalog-sync target _antigravity. Display strip (Drew 07:45 addendum): provider-display.ts strips the leading underscore for dashboard markup — keys/ids never rewritten. --- .opencode/opencode.jsonc | 63 +++++++++++-------- bin/provider-catalog-sync.mjs | 4 +- bin/provider-catalog-sync.test.mjs | 2 +- bin/sync-models.mjs | 4 +- bin/sync-models.policy.json | 2 +- .../aggregator/scripts/collect-fleet-feed.ts | 3 + pm-stack/aggregator/scripts/gather-quota.ts | 4 +- pm-stack/aggregator/src/aa.ts | 10 +++ pm-stack/aggregator/src/model.ts | 2 +- pm-stack/aggregator/src/provider-display.ts | 21 +++++-- pm-stack/aggregator/src/quota-current.ts | 5 +- pm-stack/aggregator/src/quota-extract.ts | 14 +++-- pm-stack/aggregator/src/quota-gather-map.ts | 25 ++++++-- .../aggregator/test/provider-display.test.ts | 10 +++ .../aggregator/test/quota-current.test.ts | 20 +++--- .../aggregator/test/quota-gather-map.test.ts | 16 ++--- pm-stack/aggregator/test/quota.test.ts | 26 ++++---- 17 files changed, 148 insertions(+), 83 deletions(-) diff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsonc index 2e0877f02..c54f22a9d 100644 --- a/.opencode/opencode.jsonc +++ b/.opencode/opencode.jsonc @@ -1,4 +1,15 @@ { + // PROVIDER RENAME (2026-11-07, Drew; opencode#1823): providers the + // fleet custom-built in the fork now carry a leading underscore — + // claude-code -> _claude, antigravity-direct -> _antigravity, + // vibe-direct -> _vibe, commandcode -> _commandcode, + // muse-direct -> _muse (config and fork source ids converged). + // Upstream providers keep their ids (meta included: the fork's + // meta provider is upstream code). Config-only doors over upstream + // SDK packages (opendesign, cline-pass) are unchanged. The + // underscore is a config/source marker only; display surfaces + // strip it. Older comments below narrate the pre-rename ids as + // history. Quota keeps the old spellings as aliases. // PROVIDER ALIGNMENT (2026-10-24, Drew): both machines carry the same // providers; unneeded ones are disabled here, identically on both. // - Token-based Google/Gemini paths are OFF. EARMARK: when a token-based @@ -260,7 +271,7 @@ // (~/.local/state/opencode/opencode-runtime.jsonc), layered over this file via // OPENCODE_CONFIG — see code#4544. Everything else here is deliberate config. "provider": { - "claude-code": { + "_claude": { // 2026-11-05 (code#6117, opencode#1749): repointed from the CLI proxy // (:18749, @ai-sdk/openai-compatible) to the in-fork native claude-code // provider - same provider id, native wire emulation of the Claude Code @@ -419,7 +430,7 @@ } } }, - "antigravity-direct": { + "_antigravity": { "npm": "@opencode/ai/providers/antigravity", "name": "Antigravity Direct (CLI wire clone)" // 2026-11-04 (opencode#1414): repointed from the :18751 door to @@ -440,7 +451,7 @@ // spend this API-budget key (see home/common, opencode#1653). // "models": maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544. }, - "vibe-direct": { + "_vibe": { "npm": "@opencode/ai/providers/vibe", "name": "Mistral Vibe Direct (native wire clone)", // 2026-11-04 (opencode#1653, PR #1661): native in-fork emulation of @@ -845,7 +856,7 @@ // do not merge them. The models are the contributor variants the // routes seat; the provider normalizes the v1 reasoning_effort // variant dialect onto the wire. - "muse-direct": { + "_muse": { "npm": "@opencode/ai/providers/muse-direct", "name": "Meta Muse Direct", "models": { @@ -975,7 +986,7 @@ "instanceOf": "opencode-go", "name": "OpenCode Go (popesdrew)" }, - "commandcode": { + "_commandcode": { // 2026-11-05 (code#6117, opencode#1749): repointed from the CLI proxy // (:18748, @ai-sdk/openai-compatible) to the in-fork native commandcode // provider - same provider id, native wire emulation of the Command @@ -1830,7 +1841,7 @@ // Change the leg order HERE, in this providers list, and // nowhere else. "mistral-plan": { - "providers": ["vibe-direct", "mistral"], + "providers": ["_vibe", "mistral"], "selection": "ordered" }, // opencode-go-plans (2026-11-03, Drew): the OpenCode Go plans as @@ -1958,7 +1969,7 @@ "model": "opendesign/deepseek-v4.1-flash", "variants": { "xhigh": "high", "max": "high" } }, - "commandcode/deepseek/deepseek-v4.1-flash", + "_commandcode/deepseek/deepseek-v4.1-flash", { "model": "mistral-plan/mistral-small-latest", // Variant remap: the pool's effort rungs map onto the two @@ -1981,7 +1992,7 @@ "opencode-go-plans/deepseek-v4.1-flash": 6, "cline-pass/deepseek-v4.1-flash": 1, "opendesign/deepseek-v4.1-flash": 1, - "commandcode/deepseek/deepseek-v4.1-flash": 0.5, + "_commandcode/deepseek/deepseek-v4.1-flash": 0.5, "mistral-plan/mistral-small-latest": 0.25 } }, @@ -2023,13 +2034,13 @@ "model": "opendesign/deepseek-v4-pro", "variants": { "xhigh": "high", "max": "high" } }, - "commandcode/deepseek/deepseek-v4-pro" + "_commandcode/deepseek/deepseek-v4-pro" ], "selection": "round-robin", "autonomy": "rules", "weights": { "opencode-go-plans/deepseek-v4-pro": 3, - "commandcode/deepseek/deepseek-v4-pro": 0.5 + "_commandcode/deepseek/deepseek-v4-pro": 0.5 } }, "haiku-plan": { @@ -2044,7 +2055,7 @@ // rejoins automatically on re-enable, issue #1132); OpenDesign // is the pool's live flat door today. "targets": [ - "claude-code/claude-haiku-5-5", + "_claude/claude-haiku-5-5", { "model": "opendesign/claude-haiku-5.5", "variants": { "xhigh": "high", "max": "high" } @@ -2143,7 +2154,7 @@ // rides on the direct door the same way. "targets": [ { - "model": "antigravity-direct/gemini-3.8-flash", + "model": "_antigravity/gemini-3.8-flash", "variants": { "xhigh": "high", "max": "high" } } ], @@ -2169,9 +2180,9 @@ // is single-live-door on the direct door, plus claude-code's // return. "targets": [ - "claude-code/claude-sonnet-5-5", + "_claude/claude-sonnet-5-5", { - "model": "antigravity-direct/claude-sonnet-5-5", + "model": "_antigravity/claude-sonnet-5-5", "variants": { "xhigh": "high", "max": "high" } } ], @@ -2193,9 +2204,9 @@ // "only the direct, replace all others". The direct door // serves claude-opus-5-5 and bridges tool calls. "targets": [ - "claude-code/claude-opus-5-5", + "_claude/claude-opus-5-5", { - "model": "antigravity-direct/claude-opus-5-5", + "model": "_antigravity/claude-opus-5-5", "variants": { "xhigh": "high", "max": "high" } } ], @@ -2235,9 +2246,9 @@ // leaf in this pool. "targets": [ "opencode-go-plans/muse-spark-1.3-contributor", - "commandcode/meta/muse-spark-1.3-contributor", + "_commandcode/meta/muse-spark-1.3-contributor", "cline-pass/muse-spark-1.3-contributor", - "muse-direct/muse-spark-1.3-contributor" + "_muse/muse-spark-1.3-contributor" ], "selection": "ordered", "autonomy": "rules" @@ -2272,7 +2283,7 @@ "model": "opendesign/gpt-6.1-sol", "variants": { "xhigh": "high", "max": "high" } }, - "commandcode/gpt-6.1-sol" + "_commandcode/gpt-6.1-sol" ], "selection": "round-robin", "autonomy": "rules", @@ -2349,7 +2360,7 @@ // service is retired). Same model, same pool position. "targets": [ "opencode-go-plans/gemini-4-argon", - "antigravity-direct/gemini-4-argon" + "_antigravity/gemini-4-argon" ], "selection": "round-robin", "autonomy": "rules", @@ -2366,7 +2377,7 @@ // on all three workspaces. Leaves are seated unconditionally: the // router skips disabled or quota-empty leaves at runtime. "targets": [ - "commandcode/reflection/beam:free", + "_commandcode/reflection/beam:free", "opencode-go-plans/beam-free" ], "selection": "round-robin", @@ -2389,13 +2400,13 @@ "opencode-go-plans/mimo-v2.6-flash", "cline-pass/mimo-v2.6-flash", "opendesign/mimo-v2.6-flash", - "commandcode/xiaomi/mimo-v2.6-flash" + "_commandcode/xiaomi/mimo-v2.6-flash" ], "selection": "round-robin", "autonomy": "rules", "weights": { "opencode-go-plans/mimo-v2.6-flash": 3, - "commandcode/xiaomi/mimo-v2.6-flash": 0.5 + "_commandcode/xiaomi/mimo-v2.6-flash": 0.5 } }, "scout": { @@ -2625,7 +2636,7 @@ // sonnet-plan#high stays specialist's head seat. "targets": [ "openai-plan/gpt-6-luna#xhigh", - "muse-direct/muse-spark-1.3-contributor#xhigh", + "_muse/muse-spark-1.3-contributor#xhigh", "opencode-route/deepseek-flash-plan#high", "opencode-route/sonnet-plan#medium" ], @@ -2633,7 +2644,7 @@ "autonomy": "rules", "weights": { "openai-plan/gpt-6-luna": 2, - "muse-direct/muse-spark-1.3-contributor": 2, + "_muse/muse-spark-1.3-contributor": 2, "opencode-route/deepseek-flash-plan": 2, "opencode-route/sonnet-plan": 2 } @@ -2772,7 +2783,7 @@ "targets": [ "opencode-route/opus-plan#high", "opencode-route/argon-plan#high", - "muse-direct/muse-wonder-1.0-contributor#xhigh", + "_muse/muse-wonder-1.0-contributor#xhigh", "opencode-route/sol-plan#xhigh" ], "selection": "ordered", diff --git a/bin/provider-catalog-sync.mjs b/bin/provider-catalog-sync.mjs index 11e491500..c7403419e 100644 --- a/bin/provider-catalog-sync.mjs +++ b/bin/provider-catalog-sync.mjs @@ -36,7 +36,7 @@ // through a reviewable PR. // // #4544 split: the tracked configured default no longer carries the model -// catalogs sync-models owns (antigravity-direct, google, +// catalogs sync-models owns (_antigravity, google, // openai, cloudflare-gateway) — those live in the runtime overlay // (~/.local/state/opencode/opencode-runtime.jsonc). This tool diffs the // merged effective config (default + overlay; --runtime-config) and skips @@ -562,7 +562,7 @@ async function loadModelsDev(spec) { // overlay (#4544). Catalog-sync diffs them (via the merged effective config) // but never writes them into the tracked configured default on --apply. export const SYNC_OWNED_PROVIDERS = new Set([ - 'antigravity-direct', + '_antigravity', 'google', 'openai', 'cloudflare-gateway', diff --git a/bin/provider-catalog-sync.test.mjs b/bin/provider-catalog-sync.test.mjs index b32e1a7f4..45cdefc28 100644 --- a/bin/provider-catalog-sync.test.mjs +++ b/bin/provider-catalog-sync.test.mjs @@ -436,7 +436,7 @@ test('CLI: OPENCODE_CONFIG_PATH pointing at the overlay does not redirect the ta test('SYNC_OWNED_PROVIDERS names exactly the four sync-models-owned providers (#4544)', () => { assert.deepEqual( [...SYNC_OWNED_PROVIDERS].sort(), - ['antigravity-direct', 'cloudflare-gateway', 'google', 'openai'], + ['_antigravity', 'cloudflare-gateway', 'google', 'openai'], ); }); diff --git a/bin/sync-models.mjs b/bin/sync-models.mjs index 3d31f6859..19481d15e 100755 --- a/bin/sync-models.mjs +++ b/bin/sync-models.mjs @@ -459,7 +459,7 @@ async function run() { // file keeps its comments and formatting. const edits = []; - // 1. Sync antigravity-direct (the CLI-wire door; antigravity-agy & + // 1. Sync _antigravity (the CLI-wire door; antigravity-agy & // antigravity-ls retired 2026-10-30 — see home/common/default.nix) if (agyModels.length > 0) { // Write local cache for proxies @@ -507,7 +507,7 @@ async function run() { return { context: 1048576, output: 65536 }; }; - for (const targetProvider of ['antigravity-direct']) { + for (const targetProvider of ['_antigravity']) { if (!config.provider[targetProvider]) continue; const prov = config.provider[targetProvider]; prov.models = prov.models || {}; diff --git a/bin/sync-models.policy.json b/bin/sync-models.policy.json index d85e38559..8ca90c01c 100644 --- a/bin/sync-models.policy.json +++ b/bin/sync-models.policy.json @@ -7,7 +7,7 @@ "claude-haiku": "^claude-haiku-(\\d+(?:-\\d+)?)$" }, "providers": { - "antigravity-direct": { + "_antigravity": { "keep": ["gemini-flash", "gemini-argon", "claude-opus", "claude-sonnet", "claude-haiku"], "exclude": [] } diff --git a/pm-stack/aggregator/scripts/collect-fleet-feed.ts b/pm-stack/aggregator/scripts/collect-fleet-feed.ts index 7f590c0b1..96b640572 100644 --- a/pm-stack/aggregator/scripts/collect-fleet-feed.ts +++ b/pm-stack/aggregator/scripts/collect-fleet-feed.ts @@ -273,6 +273,7 @@ function poolFor(provider: string, model: string): string | null { case "meta": return "meta"; case "claude-code": + case "_claude": return "anthropic:claude-pro"; case "openai": case "openai-codex": @@ -292,6 +293,8 @@ function poolFor(provider: string, model: string): string | null { case "antigravity-agy": case "google": return model.startsWith("gemini") ? "antigravity-direct.gemini" : "antigravity-direct.claude-gpt"; + case "_antigravity": + return model.startsWith("gemini") ? "_antigravity.gemini" : "_antigravity.claude-gpt"; default: // opencode-go is deliberately unattributed in slice 1: which // workspace (Personal vs Lab) a sandbox session burns is not diff --git a/pm-stack/aggregator/scripts/gather-quota.ts b/pm-stack/aggregator/scripts/gather-quota.ts index 58003d6f5..5278431e5 100755 --- a/pm-stack/aggregator/scripts/gather-quota.ts +++ b/pm-stack/aggregator/scripts/gather-quota.ts @@ -166,7 +166,7 @@ const OBSERVED_BY = "quota-gatherer"; * concurrency (opencode#1729); the small explicit ask gives it * room, and its result replaces the listing's timed-out one. * Remove it here when the cap is raised.) */ -const EXPLICIT_ASK_PROVIDERS = ["meta", "command-code", "deepseek", "mistral"]; +const EXPLICIT_ASK_PROVIDERS = ["meta", "_commandcode", "deepseek", "mistral"]; async function writeAtomic(path: string, text: string): Promise { await mkdir(dirname(path), { recursive: true }); @@ -570,7 +570,7 @@ async function collectRuns(tickAt: string): Promise { const t0 = Date.now() - group.ms; const entries = group.results.map((r) => entryFromResult(r, tickAt)); let run = finalizeRun(id, entries, t0); - if (id === "command-code") run = keepCommandCodePlanWindows(run); + if (id === "command-code" || id === "_commandcode") run = keepCommandCodePlanWindows(run); runs.push(run); } return runs; diff --git a/pm-stack/aggregator/src/aa.ts b/pm-stack/aggregator/src/aa.ts index 03c504156..1fddb2d44 100644 --- a/pm-stack/aggregator/src/aa.ts +++ b/pm-stack/aggregator/src/aa.ts @@ -624,6 +624,11 @@ export const AA_PLAN_FACTS: Record = { multiplier: 6, note: "$10/mo buys a $60/mo list-rate meter (6×); Flash promo cap $80 (≈8×).", }, + "_commandcode": { + plan: "Command Code GOAT", + multiplier: 7, + note: "0/mo → 0 credits (7×); the entry Go tier is → 0 credits (10×). Tier on the account is unconfirmed.", + }, commandcode: { plan: "Command Code GOAT", multiplier: 7, @@ -644,6 +649,11 @@ export const AA_PLAN_FACTS: Record = { multiplier: null, note: "Second ChatGPT account door; resolves through the fork's built-in catalog.", }, + "_claude": { + plan: "Claude plan", + multiplier: null, + note: "Claude Code door — the fork's fleet-built _claude provider (renamed from claude-code 2026-11-07, #1823).", + }, "claude-code": { plan: "Claude plan", multiplier: null, diff --git a/pm-stack/aggregator/src/model.ts b/pm-stack/aggregator/src/model.ts index c0b09ef82..57cd63db7 100644 --- a/pm-stack/aggregator/src/model.ts +++ b/pm-stack/aggregator/src/model.ts @@ -933,7 +933,7 @@ export interface AaCoverage { /** Measured models no provider catalog carries under a matched name. */ measuredNotInCatalog: string[]; /** Catalog model ids (provider/model) with no AA measurement and no - * pool seat — e.g. commandcode/reflection/beam:free. Display names + * pool seat — e.g. _commandcode/reflection/beam:free. Display names * are catalog ids, not AA names, so they can be found in the config. */ catalogNotPooledUnmeasured: string[]; } diff --git a/pm-stack/aggregator/src/provider-display.ts b/pm-stack/aggregator/src/provider-display.ts index e46a9f370..a5c5b9713 100644 --- a/pm-stack/aggregator/src/provider-display.ts +++ b/pm-stack/aggregator/src/provider-display.ts @@ -1,5 +1,10 @@ // Provider display names for dashboard markup (#6125, Drew 2026-11-05). // +// Rule 0 (#1823, Drew 2026-11-07): a leading underscore is a +// config/source-level ownership marker (fleet-built providers carry +// it: _claude, _antigravity, ...). Display surfaces strip it — the +// canonical id keeps it everywhere else. +// // Rule (dashboard only, markup only): a provider whose name ends in // "-direct" is displayed WITHOUT that suffix — but only when no // non-direct provider with the same base name exists in the same @@ -30,20 +35,26 @@ function providerHead(name: string): string { * same set. */ export function providerDisplayNames(names: Iterable): Map { - const list = [...names]; + const list = [...names].map((name) => { + const head = providerHead(name); + return head.startsWith("_") ? head.slice(1) + name.slice(head.length) : name; + }); const heads = new Set(list.map(providerHead)); const out = new Map(); - for (const name of list) { - if (out.has(name)) continue; + const originals = [...names]; + for (let i = 0; i < list.length; i++) { + const name = list[i]; + const original = originals[i]; + if (out.has(original)) continue; const head = providerHead(name); if (head.endsWith(DIRECT_SUFFIX)) { const base = head.slice(0, -DIRECT_SUFFIX.length); if (base.length > 0 && !heads.has(base)) { - out.set(name, base + name.slice(head.length)); + out.set(original, base + name.slice(head.length)); continue; } } - out.set(name, name); + out.set(original, name); } return out; } diff --git a/pm-stack/aggregator/src/quota-current.ts b/pm-stack/aggregator/src/quota-current.ts index 025460dad..7f084ed62 100644 --- a/pm-stack/aggregator/src/quota-current.ts +++ b/pm-stack/aggregator/src/quota-current.ts @@ -336,13 +336,14 @@ function summarize(file: QuotaCurrentFile, nowMs: number): GathererSummary { * "turso" is a SaaS usage row (its display surface is the SaaS cards, * via overlayTursoUsage), and "antigravity" / "opencode-go" are the * COMBINED account rows whose pool-level rendering is their split - * rows (antigravity-direct.gemini / antigravity-direct.claude-gpt and + * rows (_antigravity.gemini / _antigravity.claude-gpt — pre-rename: + * antigravity-direct.gemini / antigravity-direct.claude-gpt — and * opencode-go.drewrypope / opencode-go.popesdrew, produced by * entriesWithPoolSplits in quota-gather-map.ts). Synthesizing pools * for them would double-render the same read. Every OTHER serviceId * the read reports renders as a pool — see the synthesis below. */ -const NON_POOL_SERVICE_IDS: ReadonlySet = new Set(["turso", "antigravity", "opencode-go"]); +const NON_POOL_SERVICE_IDS: ReadonlySet = new Set(["turso", "antigravity", "_antigravity", "opencode-go"]); /** * Overlay a parsed quota-current document onto a quota view. Pure: diff --git a/pm-stack/aggregator/src/quota-extract.ts b/pm-stack/aggregator/src/quota-extract.ts index 8fec8481a..6d5b975e1 100644 --- a/pm-stack/aggregator/src/quota-extract.ts +++ b/pm-stack/aggregator/src/quota-extract.ts @@ -517,6 +517,12 @@ interface PoolSpec { // antigravity-direct.gemini / antigravity-direct.claude-gpt — the // opencode-go. pattern (Drew, 2026-11-03: "why are you not // including antigravity in the board?"). Ground truth for the +// RENAMED 2026-11-07 (#1823, Drew): fleet-built providers carry a +// leading underscore — the commandcode pool is now _commandcode and +// the Antigravity pools ride under _antigravity.gemini / +// _antigravity.claude-gpt. Per the rule above, each starts a NEW +// snapshot series; the pre-rename series stay in the store under +// their old ids, unrewritten. // choice: the deployed config defines antigravity-agy, // antigravity-direct and antigravity-ls (ls/agy are the disabled // legacy doors; no antigravity-local provider exists), and @@ -585,7 +591,7 @@ export const POOL_SPECS: PoolSpec[] = [ shellNote: "No current read (dashboard-only source).", }, { - id: "commandcode", + id: "_commandcode", provider: "Command Code", plan: "GO", heading: /^### Command Code/, @@ -593,7 +599,7 @@ export const POOL_SPECS: PoolSpec[] = [ shellNote: "No current read.", }, { - id: "antigravity-direct.gemini", + id: "_antigravity.gemini", provider: "Antigravity", plan: "Gemini pool", heading: /^### Gemini/, @@ -601,7 +607,7 @@ export const POOL_SPECS: PoolSpec[] = [ shellNote: "No current read.", }, { - id: "antigravity-direct.claude-gpt", + id: "_antigravity.claude-gpt", provider: "Antigravity", plan: "Claude+GPT pool", heading: /^### Gemini/, @@ -639,7 +645,7 @@ const SHELL_POOLS: QuotaPool[] = [ * OpenCode config door sat in disabled_providers. That hid live, * measured pools whose traffic runs through model routes rather than * the disabled direct door: at removal time the deployed board was - * missing anthropic:claude-pro, commandcode, deepseek and BOTH + * missing anthropic:claude-pro, _commandcode, deepseek and BOTH * Antigravity pools even though the OpenCode quota read reported * them. Pool assembly no longer consults disabled_providers at all; * extractQuotaPools returns every pool it knows, and the serve-time diff --git a/pm-stack/aggregator/src/quota-gather-map.ts b/pm-stack/aggregator/src/quota-gather-map.ts index fff87b543..da3e02007 100644 --- a/pm-stack/aggregator/src/quota-gather-map.ts +++ b/pm-stack/aggregator/src/quota-gather-map.ts @@ -89,6 +89,7 @@ export function normalizeResetAt(v: unknown): string | null { export function serviceIdFor(providerId: string): string { switch (providerId) { case "claude": + case "_claude": return "anthropic:claude-pro"; case "codex": return "openai.main"; @@ -96,6 +97,8 @@ export function serviceIdFor(providerId: string): string { return "cline-pass"; case "command-code": return "commandcode"; + case "_commandcode": + return "_commandcode"; case "deepseek": return "deepseek"; case "meta": @@ -122,8 +125,13 @@ export const GATHERER_SOURCE = "opencode-quota"; */ export const GO_DREWRYPOPE_SERVICE_ID = "opencode-go.drewrypope"; export const GO_POPESDREW_SERVICE_ID = "opencode-go.popesdrew"; -export const ANTIGRAVITY_GEMINI_SERVICE_ID = "antigravity-direct.gemini"; -export const ANTIGRAVITY_CLAUDE_GPT_SERVICE_ID = "antigravity-direct.claude-gpt"; +export const ANTIGRAVITY_GEMINI_SERVICE_ID = "_antigravity.gemini"; +export const ANTIGRAVITY_CLAUDE_GPT_SERVICE_ID = "_antigravity.claude-gpt"; +// Pre-rename (#1823) split ids: a gatherer still paired with the old +// fork binary reports providerId "antigravity" and its rows keep the +// historical series; the renamed provider starts the new series. +export const ANTIGRAVITY_LEGACY_GEMINI_SERVICE_ID = "antigravity-direct.gemini"; +export const ANTIGRAVITY_LEGACY_CLAUDE_GPT_SERVICE_ID = "antigravity-direct.claude-gpt"; /** * Which split Go pool a per-workspace entry belongs to, from the @@ -148,7 +156,8 @@ export function goPoolServiceId(entry: QuotaCurrentEntry): string | null { * Claude+GPT pool. Quota grouping must use the same rule, or burn and * quota would disagree about which pool a model draws from. */ -function antigravityPoolForModel(model: string): string { +function antigravityPoolForModel(model: string, legacy = false): string { + if (legacy) return model.startsWith("gemini") ? ANTIGRAVITY_LEGACY_GEMINI_SERVICE_ID : ANTIGRAVITY_LEGACY_CLAUDE_GPT_SERVICE_ID; return model.startsWith("gemini") ? ANTIGRAVITY_GEMINI_SERVICE_ID : ANTIGRAVITY_CLAUDE_GPT_SERVICE_ID; } @@ -169,7 +178,11 @@ function antigravityPoolRows(entry: QuotaCurrentEntry): QuotaCurrentEntry[] { // A failed provider read lapses both pools loudly — history // retained, no stale % presented as current — instead of leaving // the pools on their dated reads with no signal the source died. - return [ANTIGRAVITY_GEMINI_SERVICE_ID, ANTIGRAVITY_CLAUDE_GPT_SERVICE_ID].map((serviceId) => ({ + const ids = + entry.providerId === "antigravity" + ? [ANTIGRAVITY_LEGACY_GEMINI_SERVICE_ID, ANTIGRAVITY_LEGACY_CLAUDE_GPT_SERVICE_ID] + : [ANTIGRAVITY_GEMINI_SERVICE_ID, ANTIGRAVITY_CLAUDE_GPT_SERVICE_ID]; + return ids.map((serviceId) => ({ ...entry, serviceId, })); @@ -181,7 +194,7 @@ function antigravityPoolRows(entry: QuotaCurrentEntry): QuotaCurrentEntry[] { const sep = w.name.lastIndexOf(":"); if (sep <= 0 || sep === w.name.length - 1) continue; if (w.pctOfLimit == null) continue; - const pool = antigravityPoolForModel(w.name.slice(0, sep)); + const pool = antigravityPoolForModel(w.name.slice(0, sep), entry.providerId === "antigravity"); const winName = w.name.slice(sep + 1); let group = best.get(pool); if (!group) { @@ -224,7 +237,7 @@ export function entriesWithPoolSplits(entries: readonly QuotaCurrentEntry[]): Qu // their dated reads until a real read (ok or error) arrives. const serviceId = goPoolServiceId(entry); if (serviceId && entry.state !== "unconfigured") out.push({ ...entry, serviceId }); - } else if (entry.providerId === "antigravity") { + } else if (entry.providerId === "antigravity" || entry.providerId === "_antigravity") { out.push(...antigravityPoolRows(entry)); } } diff --git a/pm-stack/aggregator/test/provider-display.test.ts b/pm-stack/aggregator/test/provider-display.test.ts index d42f46fae..d96be4ac9 100644 --- a/pm-stack/aggregator/test/provider-display.test.ts +++ b/pm-stack/aggregator/test/provider-display.test.ts @@ -25,6 +25,16 @@ describe("providerDisplayNames (#6125)", () => { expect(providerDisplayName("openai-direct", ["openai-direct", "openai"])).toBe("openai-direct"); }); + test("strips the leading-underscore ownership marker (#1823, Drew 2026-11-07)", () => { + const names = providerDisplayNames(["_claude", "_antigravity.gemini", "_antigravity.claude-gpt", "meta"]); + expect(names.get("_claude")).toBe("claude"); + expect(names.get("_antigravity.gemini")).toBe("antigravity.gemini"); + expect(names.get("_antigravity.claude-gpt")).toBe("antigravity.claude-gpt"); + expect(names.get("meta")).toBe("meta"); + // Keys stay the exact canonical input strings — ids are never rewritten. + expect([...names.keys()].sort()).toEqual(["_antigravity.claude-gpt", "_antigravity.gemini", "_claude", "meta"]); + }); + test("non-direct names are untouched", () => { const names = providerDisplayNames(["mistral", "openai.main", "cline-pass", "direct"]); expect(names.get("mistral")).toBe("mistral"); diff --git a/pm-stack/aggregator/test/quota-current.test.ts b/pm-stack/aggregator/test/quota-current.test.ts index c2a856131..e94176d48 100644 --- a/pm-stack/aggregator/test/quota-current.test.ts +++ b/pm-stack/aggregator/test/quota-current.test.ts @@ -30,7 +30,7 @@ function baseView(): QuotaView { pool("meta", [{ name: "weekly", unit: "other", limit: 100, used: 100, percent: 100, resetsAt: null }], "walled"), pool("deepseek", []), pool("cline-pass", [{ name: "monthly", unit: "other", limit: 100, used: 69, percent: 69, resetsAt: null }]), - pool("commandcode", [{ name: "monthly credits", unit: "usd", limit: 10, used: 6.57, resetsAt: null }]), + pool("_commandcode", [{ name: "monthly credits", unit: "usd", limit: 10, used: 6.57, resetsAt: null }]), ], burn: [], choices: { hasHeadroom: [], burnBeforeReset: [], doNotStart: ["meta"] }, @@ -254,7 +254,7 @@ describe("quota-current overlay", () => { test("pools with no gatherer entry are untouched and carry no freshness", () => { const out = overlayQuotaCurrent(baseView(), file([entry({ serviceId: "meta", windows: [] })]), NOW); - const cc = out.pools.find((p) => p.id === "commandcode")!; + const cc = out.pools.find((p) => p.id === "_commandcode")!; expect(cc.freshness).toBeUndefined(); expect(cc.windows[0].used).toBe(6.57); expect(cc.state).toBe("healthy"); @@ -742,8 +742,8 @@ describe("overlay: split gatherer rows land on the four split hub pools (#1331)" view.pools.push( pool("opencode-go.drewrypope", []), pool("opencode-go.popesdrew", []), - pool("antigravity-direct.gemini", []), - pool("antigravity-direct.claude-gpt", []), + pool("_antigravity.gemini", []), + pool("_antigravity.claude-gpt", []), ); const out = overlayQuotaCurrent( view, @@ -764,12 +764,12 @@ describe("overlay: split gatherer rows land on the four split hub pools (#1331)" }), entry({ providerId: "antigravity", - serviceId: "antigravity-direct.gemini", + serviceId: "_antigravity.gemini", windows: [win("weekly", 40, iso(5 * 60_000))], }), entry({ providerId: "antigravity", - serviceId: "antigravity-direct.claude-gpt", + serviceId: "_antigravity.claude-gpt", windows: [win("weekly", 90, iso(5 * 60_000))], }), ]), @@ -778,15 +778,15 @@ describe("overlay: split gatherer rows land on the four split hub pools (#1331)" const byId = new Map(out.pools.map((p) => [p.id, p])); expect(byId.get("opencode-go.drewrypope")!.windows.map((w) => [w.name, w.percent])).toEqual([["monthly", 62.5]]); expect(byId.get("opencode-go.popesdrew")!.windows.map((w) => [w.name, w.percent])).toEqual([["monthly", 50]]); - expect(byId.get("antigravity-direct.gemini")!.windows.map((w) => [w.name, w.percent])).toEqual([["weekly", 40]]); - expect(byId.get("antigravity-direct.claude-gpt")!.windows.map((w) => [w.name, w.percent])).toEqual([ + expect(byId.get("_antigravity.gemini")!.windows.map((w) => [w.name, w.percent])).toEqual([["weekly", 40]]); + expect(byId.get("_antigravity.claude-gpt")!.windows.map((w) => [w.name, w.percent])).toEqual([ ["weekly", 90], ]); for (const id of [ "opencode-go.drewrypope", "opencode-go.popesdrew", - "antigravity-direct.gemini", - "antigravity-direct.claude-gpt", + "_antigravity.gemini", + "_antigravity.claude-gpt", ]) { expect(byId.get(id)!.freshness).toEqual({ measuredAt: iso(5 * 60_000), diff --git a/pm-stack/aggregator/test/quota-gather-map.test.ts b/pm-stack/aggregator/test/quota-gather-map.test.ts index e1312fbf2..8a4cf7eb5 100644 --- a/pm-stack/aggregator/test/quota-gather-map.test.ts +++ b/pm-stack/aggregator/test/quota-gather-map.test.ts @@ -899,7 +899,7 @@ describe("pool splits (#1331)", () => { }); const antigravityResult = (models: Record>): QuotaProviderResult => ({ - providerId: "antigravity", + providerId: "_antigravity", providerName: "Antigravity", ok: true, configured: true, @@ -931,11 +931,11 @@ describe("pool splits (#1331)", () => { }), TICK, ); - expect(entry.serviceId).toBe("antigravity"); + expect(entry.serviceId).toBe("_antigravity"); expect(entry.windows).toHaveLength(6); const split = entriesWithPoolSplits([entry]); expect(split).toHaveLength(3); - expect(split[0].serviceId).toBe("antigravity"); + expect(split[0].serviceId).toBe("_antigravity"); const gemini = split.find((e) => e.serviceId === ANTIGRAVITY_GEMINI_SERVICE_ID)!; expect(gemini.windows.map((w) => [w.name, w.pctOfLimit])).toEqual([ ["5h", 70], @@ -967,13 +967,13 @@ describe("pool splits (#1331)", () => { const geminiOnly = entriesWithPoolSplits([ entryFromResult(antigravityResult({ "gemini-flash": { weekly: 55 } }), TICK), ]); - expect(geminiOnly.map((e) => e.serviceId).sort()).toEqual(["antigravity", ANTIGRAVITY_GEMINI_SERVICE_ID]); + expect(geminiOnly.map((e) => e.serviceId).sort()).toEqual(["_antigravity", ANTIGRAVITY_GEMINI_SERVICE_ID]); }); test("Antigravity error lapses both pools; unconfigured splits nothing", () => { const err = entryFromResult( { - providerId: "antigravity", + providerId: "_antigravity", ok: false, configured: true, error: "Failed to refresh Antigravity token", @@ -983,7 +983,7 @@ describe("pool splits (#1331)", () => { ); const split = entriesWithPoolSplits([err]); expect(split.map((e) => e.serviceId).sort()).toEqual([ - "antigravity", + "_antigravity", ANTIGRAVITY_CLAUDE_GPT_SERVICE_ID, ANTIGRAVITY_GEMINI_SERVICE_ID, ]); @@ -993,11 +993,11 @@ describe("pool splits (#1331)", () => { } const unconfigured = entriesWithPoolSplits([ entryFromResult( - { providerId: "antigravity", ok: false, configured: false, error: "Not configured", usage: null }, + { providerId: "_antigravity", ok: false, configured: false, error: "Not configured", usage: null }, TICK, ), ]); - expect(unconfigured.map((e) => e.serviceId)).toEqual(["antigravity"]); + expect(unconfigured.map((e) => e.serviceId)).toEqual(["_antigravity"]); }); }); diff --git a/pm-stack/aggregator/test/quota.test.ts b/pm-stack/aggregator/test/quota.test.ts index 88cd2002e..74d4ef100 100644 --- a/pm-stack/aggregator/test/quota.test.ts +++ b/pm-stack/aggregator/test/quota.test.ts @@ -94,7 +94,7 @@ describe("quota extractors", () => { extraWindows: 0, }, { - id: "commandcode", + id: "_commandcode", view: (reset: string) => `\n### Command Code\n$6.57 of $10 used; 5h 1.2%, weekly 8.8%; period ends ${reset}, 18:01 UTC.\n`, window: { name: "monthly credits", unit: "usd", limit: 10, used: 6.57, percent: 65.7 }, @@ -115,7 +115,7 @@ describe("quota extractors", () => { expect(pool.windows).toHaveLength(1 + consumer.extraWindows); expect(pool.windows[0]).toMatchObject(consumer.window); expect(pool.windows[0].resetsAt).toBe(reset.expected); - if (consumer.id === "commandcode") { + if (consumer.id === "_commandcode") { expect(pool.windows.slice(1).map((window) => window.percent)).toEqual([1.2, 8.8]); } } @@ -134,7 +134,7 @@ describe("quota extractors", () => { view: `\n### OpenCode Go ×2 workspaces\n- **drewrypope — monthly 60% used**; monthly reset ${pastDate}, 18:01 UTC.\n`, }, { - id: "commandcode", + id: "_commandcode", view: `\n### Command Code\n$6.57 of $10 used; 5h 1.2%, weekly 8.8%; period ends ${pastDate}, 18:01 UTC.\n`, }, ]; @@ -238,7 +238,7 @@ describe("quota extractors", () => { }); test("command code credits + short windows", () => { - const p = byId.get("commandcode")!; + const p = byId.get("_commandcode")!; expect(p.windows[0]).toMatchObject({ unit: "usd", used: 6.57, limit: 10 }); expect(p.windows[1].percent).toBe(1.2); expect(p.windows[2].percent).toBe(8.8); @@ -249,7 +249,7 @@ describe("quota extractors", () => { ### Command Code - **Usage / dates:** **Newer dated read (model-efficiency plan, freshest reads 2026-10-25 morning): $6.57 of $10 used ($3.43 left); 5h 1.2%, weekly 8.8%; period ends Nov 2, 23:04 UTC.** **Freshest dated read (console, 2026-10-27 10:05 CDT, commandcode.ai Settings): monthly limit 69% used, resets Nov 2; weekly limit 14% (resets in 4d); 5-hour limit 0% ("No usage in this window yet"); extra/top-up credits $0.00 balance.** `; - const p = extractQuotaPools(multi, NOW).find((x) => x.id === "commandcode")!; + const p = extractQuotaPools(multi, NOW).find((x) => x.id === "_commandcode")!; expect(p.windows.map((w) => [w.name, w.percent])).toEqual([ ["monthly", 69], ["weekly", 14], @@ -264,7 +264,7 @@ describe("quota extractors", () => { ### Command Code - **Usage / dates:** **Dated read (2026-10-25): $6.57 of $10 used; 5h 1.2%, weekly 8.8%; period ends Nov 2, 23:04 UTC.** **Freshest dated read (2026-10-30): monthly limit 55 percent used (the console printed the figure in words this cycle).** `; - const p = extractQuotaPools(stale, NOW).find((x) => x.id === "commandcode")!; + const p = extractQuotaPools(stale, NOW).find((x) => x.id === "_commandcode")!; expect(p.windows).toEqual([]); }); @@ -273,7 +273,7 @@ describe("quota extractors", () => { ### Command Code - **Usage / dates:** **Dated read (2026-10-30 09:00 CDT): monthly limit 55% used; weekly limit 20%; 5-hour limit 3%.** **Dated update (2026-10-30 12:00 CDT): monthly limit 100 percent used (the console printed the figure in words).** `; - const p = extractQuotaPools(sameDay, NOW).find((x) => x.id === "commandcode")!; + const p = extractQuotaPools(sameDay, NOW).find((x) => x.id === "_commandcode")!; expect(p.windows).toEqual([]); }); @@ -282,13 +282,13 @@ describe("quota extractors", () => { ### Command Code - **Usage / dates:** **Dated read (2026-10-30): extra/top-up credits $0.10 balance; hub credits 0.1 flat.** `; - const p = extractQuotaPools(balanceOnly, NOW).find((x) => x.id === "commandcode")!; + const p = extractQuotaPools(balanceOnly, NOW).find((x) => x.id === "_commandcode")!; expect(p.windows).toEqual([]); }); test("antigravity pools are independent, remaining -> used", () => { - expect(byId.get("antigravity-direct.gemini")!.windows[0].percent).toBeCloseTo(0.9); - expect(byId.get("antigravity-direct.claude-gpt")!.windows[0].percent).toBe(0); + expect(byId.get("_antigravity.gemini")!.windows[0].percent).toBeCloseTo(0.9); + expect(byId.get("_antigravity.claude-gpt")!.windows[0].percent).toBe(0); }); test("unreadable doc fails soft: identity + note, no invented numbers", () => { @@ -392,9 +392,9 @@ describe("pass-through pool assembly (Drew, 2026-11-03)", () => { "opencode-go.drewrypope", "opencode-go.popesdrew", "cline-pass", - "commandcode", - "antigravity-direct.gemini", - "antigravity-direct.claude-gpt", + "_commandcode", + "_antigravity.gemini", + "_antigravity.claude-gpt", "opendesign", "deepseek", ]);