From b224973afaaf9d6a9d0baad06feef06949579fb5 Mon Sep 17 00:00:00 2001 From: "developing-today[bot]" <5454422+developing-today[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 13:24:34 -0600 Subject: [PATCH] feat(aggregator): rename the main ChatGPT pool openai -> openai.main Follows the config rename (PR #5085): pool ids are the OpenCode config provider ids (POOL NAMING note, 2026-11-03), and the config now defines openai.main for the main account. The codex gatherer door now files under openai.main, POOL_SPECS carries the new id, and usage snapshot records write the new serviceId. The pre-rename series stays in the store under openai, unrewritten, per the naming convention. Tests updated where they bound the old pool id; synthetic overlay fixtures keep their arbitrary ids. --- pm-stack/aggregator/src/quota-extract.ts | 10 +++++----- pm-stack/aggregator/src/quota-gather-map.ts | 2 +- pm-stack/aggregator/src/snapshot-records.ts | 2 +- pm-stack/aggregator/test/quota-gather-map.test.ts | 2 +- pm-stack/aggregator/test/quota.test.ts | 10 +++++----- pm-stack/aggregator/test/snapshot-writers.test.ts | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pm-stack/aggregator/src/quota-extract.ts b/pm-stack/aggregator/src/quota-extract.ts index 01a87c2603..9518b77399 100644 --- a/pm-stack/aggregator/src/quota-extract.ts +++ b/pm-stack/aggregator/src/quota-extract.ts @@ -12,7 +12,7 @@ // assistant's Power subscription is never a pool, so no extractor here // emits either. // exactly TWO ChatGPT pools — the main account (drewrypope) reached -// through the `codex` gatherer door (pool openai) and the +// through the `codex` gatherer door (pool openai.main) and the // alternate account (popesdrew) through the `openai.alternate` door // (pool openai.alternate). Separate accounts, separate allowances: // never collapse them into one pool. @@ -462,7 +462,7 @@ interface PoolSpec { } // POOL NAMING (2026-11-03, Drew): a pool's id is its OpenCode config -// provider id whenever the config defines one — meta, openai, +// provider id whenever the config defines one — meta, openai.main, // openai.alternate, opencode-go.drewrypope, opencode-go.popesdrew, cline-pass, // opendesign, deepseek, commandcode. The colon-suffixed spellings these // replaced (meta:high-usage, openai:codex, opencode-go:drewrypope, ...) @@ -502,9 +502,9 @@ export const POOL_SPECS: PoolSpec[] = [ shellNote: "No current read (console-only usage).", }, { - id: "openai", + id: "openai.main", provider: "OpenAI", - plan: "ChatGPT (Codex pool)", + plan: "ChatGPT (Main — drewrypope)", heading: /^### ChatGPT/, extract: extractCodex, shellNote: "No current read. OpenAI is the fleet's final reserve pool.", @@ -516,7 +516,7 @@ export const POOL_SPECS: PoolSpec[] = [ heading: /^### ChatGPT \(Alternate\)/, extract: extractChatGptAlternate, shellNote: - "No dated read. The fleet's second ChatGPT account (popesdrew), measured live by the quota gatherer through the openai.alternate credential — a separate pool from the main account (openai); the two are never combined.", + "No dated read. The fleet's second ChatGPT account (popesdrew), measured live by the quota gatherer through the openai.alternate credential — a separate pool from the main account (openai.main); the two are never combined.", }, { id: "opencode-go.drewrypope", diff --git a/pm-stack/aggregator/src/quota-gather-map.ts b/pm-stack/aggregator/src/quota-gather-map.ts index e5d7eb9363..aa9840bf9f 100644 --- a/pm-stack/aggregator/src/quota-gather-map.ts +++ b/pm-stack/aggregator/src/quota-gather-map.ts @@ -72,7 +72,7 @@ export function serviceIdFor(providerId: string): string { case "claude": return "anthropic:claude-pro"; case "codex": - return "openai"; + return "openai.main"; case "cline-pass": return "cline-pass"; case "command-code": diff --git a/pm-stack/aggregator/src/snapshot-records.ts b/pm-stack/aggregator/src/snapshot-records.ts index 46e9c009c7..871287fbed 100644 --- a/pm-stack/aggregator/src/snapshot-records.ts +++ b/pm-stack/aggregator/src/snapshot-records.ts @@ -308,7 +308,7 @@ export function recordsFromProviderUsage(snap: unknown, observedBy: string): Sna if (!metricId) return; out.push({ ts, - serviceId: "openai", + serviceId: "openai.main", metricId, value: win.used_percent, unit: "pct", diff --git a/pm-stack/aggregator/test/quota-gather-map.test.ts b/pm-stack/aggregator/test/quota-gather-map.test.ts index 913cffd220..e6aae26914 100644 --- a/pm-stack/aggregator/test/quota-gather-map.test.ts +++ b/pm-stack/aggregator/test/quota-gather-map.test.ts @@ -530,7 +530,7 @@ describe("entryFromFileExport (Meta #1301 convention)", () => { describe("serviceIdFor", () => { test("known pools map to hub ids; others pass through", () => { - expect(serviceIdFor("codex")).toBe("openai"); + expect(serviceIdFor("codex")).toBe("openai.main"); expect(serviceIdFor("deepseek")).toBe("deepseek"); expect(serviceIdFor("meta")).toBe("meta"); expect(serviceIdFor("opendesign")).toBe("opendesign"); diff --git a/pm-stack/aggregator/test/quota.test.ts b/pm-stack/aggregator/test/quota.test.ts index 7d81efad7b..88cd2002e1 100644 --- a/pm-stack/aggregator/test/quota.test.ts +++ b/pm-stack/aggregator/test/quota.test.ts @@ -73,7 +73,7 @@ describe("quota extractors", () => { }); test("codex 7-day read", () => { - const p = byId.get("openai")!; + const p = byId.get("openai.main")!; expect(p.windows[0].percent).toBe(11); expect(p.windows[0].resetsAt).toBe("2026-10-30T18:01:00.000Z"); }); @@ -81,7 +81,7 @@ describe("quota extractors", () => { test("month-based resets normalize month case and preserve reads for invalid dates across extractors", () => { const consumers = [ { - id: "openai", + id: "openai.main", view: (reset: string) => `\n### ChatGPT — main account plans\n7-day 42% used; resets ${reset}, 18:01 UTC.\n`, window: { name: "7-day", percent: 42 }, extraWindows: 0, @@ -126,7 +126,7 @@ describe("quota extractors", () => { const pastDate = "Sep 24"; const cases = [ { - id: "openai", + id: "openai.main", view: `\n### ChatGPT — main account plans\n7-day 42% used; resets ${pastDate}, 18:01 UTC.\n`, }, { @@ -349,7 +349,7 @@ describe("windowPercent + guidance", () => { const pools = extractQuotaPools(VIEW, NOW); const choices = computeChoices(pools, NOW.getTime()); expect(choices.doNotStart).toContain("meta"); - expect(choices.hasHeadroom).toContain("openai"); + expect(choices.hasHeadroom).toContain("openai.main"); expect(choices.hasHeadroom).not.toContain("meta"); // Claude resets in >24h; nothing in this fixture resets within a day // with headroom, so burn-before-reset is empty. @@ -387,7 +387,7 @@ describe("pass-through pool assembly (Drew, 2026-11-03)", () => { expect(extractQuotaPools(VIEW, NOW).map((p) => p.id)).toEqual([ "meta", "anthropic:claude-pro", - "openai", + "openai.main", "openai.alternate", "opencode-go.drewrypope", "opencode-go.popesdrew", diff --git a/pm-stack/aggregator/test/snapshot-writers.test.ts b/pm-stack/aggregator/test/snapshot-writers.test.ts index adea404356..039488da23 100644 --- a/pm-stack/aggregator/test/snapshot-writers.test.ts +++ b/pm-stack/aggregator/test/snapshot-writers.test.ts @@ -206,8 +206,8 @@ describe("recordsFromProviderUsage", () => { const recs = recordsFromProviderUsage(answered, "check-usage"); expect(recs.map((r) => `${r.serviceId}/${r.metricId}=${r.value}`)).toEqual([ "opencode-server/sessions-listed=0", - "openai/7-day=12", - "openai/5-hour=3", + "openai.main/7-day=12", + "openai.main/5-hour=3", ]); expect(recordsFromProviderUsage(null, "check-usage")).toEqual([]); expect(recordsFromProviderUsage({ sessions: [] }, "check-usage")).toEqual([]); @@ -229,7 +229,7 @@ describe("recordsFromProviderUsage", () => { expect( recordsFromProviderUsage(snapshot, "check-usage").map((r) => `${r.serviceId}/${r.metricId}=${r.value}`), - ).toEqual(["opencode-server/sessions-listed=1", "openai/5-hour=100"]); + ).toEqual(["opencode-server/sessions-listed=1", "openai.main/5-hour=100"]); }); test("skips percentages above 100 and non-finite values", () => { @@ -266,7 +266,7 @@ describe("recordsFromProviderUsage", () => { expect( recordsFromProviderUsage(snapshot, "check-usage").map((r) => `${r.serviceId}/${r.metricId}=${r.value}`), - ).toEqual(["openai/7-day=0", "openai/5-hour=100"]); + ).toEqual(["openai.main/7-day=0", "openai.main/5-hour=100"]); }); });