Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(usage): pool subscription limits per provider across accounts and environments #10300

Mergedjuliusmarmingemerged 8 commits intomain fromrefs/pull/10300/headmerged by juliusmarminge View on GitHub

Showing 9 changed files with 19 additions and 1 deletion (loading 7).

x
0 of 9 viewed, 9 left
16 additions and 0 deletionsapps/server/src/usage/cliproxyUsageLimits.test.tsModified
View file
@@ -102,6 +102,22 @@
]);
});
+​
+ it("names a Codex five-hour window `primary`, as the Codex driver does", () => {
+ const accounts = cliproxyStatusToAccounts(
+ {
+ accounts: {
+ "codex-abc-someone@example.com-pro.json": {
+ provider: "codex",
+ plan: "pro",
+ five_hour: { hard_limited: false, known: true, used_percent: 40 },
+ },
+ },
+ },
+ checkedAt,
+ );
+ expect(accounts[0]?.usageLimits.windows.map((window) => window.id)).toEqual(["primary"]);
+ });
});
​
describe("accountEmailFromAuthFile", () => {
3 additions and 1 deletionapps/server/src/usage/cliproxyUsageLimits.tsModified
View file
@@ -124,7 +124,9 @@
if (!window || window.known === false) continue;
const resetsAt = isoFromHub(window.reset_at);