GeezerVison is showing github.com — fix(shared): a zero-credit cap no longer marks seat-based Codex out o… · pingdotgg/t3code@c99cd28
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/shared/src/usageLimits.test.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -130,6 +130,7 @@ describe("new thread model fallback", () => { | 130 | 130 | ["antigravity", ["gemini-weekly"], "claude-opus-5-5", false], | 131 | 131 | ["antigravity", ["3p-weekly"], "claude-opus-5-5", true], | 132 | 132 | ["antigravity", ["gemini-weekly"], "antigravity-default", true], | | 133 | + ["codex", ["individual"], "gpt-5.5", true], | 133 | 134 | ["opencode", ["go_weekly"], "opencode/big-pickle", false], | 134 | 135 | ["opencode", ["go_weekly"], "opencode-go/big-pickle", true], | 135 | 136 | ] as const)("matches %s pools %s to %s", (driver, ids, model, usesFallback) => { | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/src/usageLimits.ts +9-1Lines changed: 9 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -28,7 +28,8 @@ export function exhaustedUsageWindow( | 28 | 28 | now: number, | 29 | 29 | model?: string, | 30 | 30 | ) { | 31 | | - const exhausted = (provider?.usageLimits?.windows ?? []).filter( | | 31 | + const windows = provider?.usageLimits?.windows ?? []; | | 32 | + const exhausted = windows.filter( | 32 | 33 | (window) => | 33 | 34 | (window.usedPercent ?? 0) >= 100 && | 34 | 35 | (!window.resetsAt || | @@ -54,6 +55,13 @@ export function exhaustedUsageWindow( | 54 | 55 | ); | 55 | 56 | }); | 56 | 57 | } | | 58 | + case "codex": { | | 59 | + // Seat-based plans spend credits only past their plan windows, so the credit cap blocks only plans without them. | | 60 | + const hasPlanWindows = windows.some( | | 61 | + (window) => window.id === "primary" || window.id === "secondary", | | 62 | + ); | | 63 | + return exhausted.find((window) => window.id !== "individual" || !hasPlanWindows); | | 64 | + } | 57 | 65 | case "opencode": | 58 | 66 | return exhausted.find( | 59 | 67 | (window) => !window.id.startsWith("go_") || model.startsWith("opencode-go/"), | |
|