Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(usage): deduplicate native subscription accounts #10700

Mergedstephenjason89(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/10700/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 133 additions and 18 deletions.

x
0 of 2 viewed, 2 left
88 additions and 1 deletionpackages/shared/src/usageLimits.test.tsModified
View file
@@ -1249,7 +1249,7 @@
expect(report?.accounts[0]?.limits.resetCredits?.availableCount).toBe(3);
- it("keeps accounts and custom instances separate, filtering by driver", () => {
+ it("keeps unidentified custom instances separate, filtering by driver", () => {
const report = collectProviderUsageLimits(
selected.instanceId,
@@ -1290,6 +1290,93 @@
expect(report?.notices).toEqual([]);
+ it("keeps the freshest usable native duplicate and the freshest native credits in either order", () => {
+ const failed = provider({
+ auth: selected.auth,
+ usageLimits: {
+ ...limits,
+ checkedAt: "2026-09-03T11:40:00.000Z",
+ unavailable: { reason: "probeFailed" },
+ },
+ });
+ const credited = provider({
+ instanceId: ProviderInstanceId.make("codex-credit"),
+ auth: selected.auth,
+ usageLimits: {
+ checkedAt: "2026-09-03T11:20:00.000Z",
+ windows: [{ ...window, usedPercent: 50 }],
+ resetCredits: { availableCount: 2 },