diff --git a/pm-stack/aggregator/src/quota-extract.ts b/pm-stack/aggregator/src/quota-extract.ts index 597684ed57..e664d2c5df 100644 --- a/pm-stack/aggregator/src/quota-extract.ts +++ b/pm-stack/aggregator/src/quota-extract.ts @@ -554,7 +554,7 @@ export const POOL_SPECS: PoolSpec[] = [ id: "openai.main", provider: "OpenAI", plan: "ChatGPT (Main — drewrypope)", - heading: /^### ChatGPT/, + heading: /^### ChatGPT(?! \(Alternate\))/, extract: extractCodex, shellNote: "No current read. OpenAI is the fleet's final reserve pool.", }, diff --git a/pm-stack/aggregator/test/quota.test.ts b/pm-stack/aggregator/test/quota.test.ts index 74d4ef100d..b3760accaf 100644 --- a/pm-stack/aggregator/test/quota.test.ts +++ b/pm-stack/aggregator/test/quota.test.ts @@ -154,6 +154,16 @@ describe("quota extractors", () => { expect(p.windows).toEqual([]); }); + test("main and alternate ChatGPT sections never cross-read, in either order (#8005)", () => { + const mainSection = "### ChatGPT — main account plans\n- 7-day 11% used, resets Oct 30, 18:01 UTC.\n"; + const altSection = "### ChatGPT (Alternate)\n- 7-day 42% used.\n"; + for (const view of ["\n" + altSection + "\n" + mainSection, "\n" + mainSection + "\n" + altSection]) { + const m = new Map(extractQuotaPools(view, NOW).map((p) => [p.id, p])); + expect(m.get("openai.main")!.windows[0].percent).toBe(11); + expect(m.get("openai.alternate")!.windows[0].percent).toBe(42); + } + }); + test("meta is walled until the weekly reset — and it is the only Meta pool", () => { const p = byId.get("meta")!; expect(p.state).toBe("walled");