Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): omit native quota for custom Codex providers #10877

Closedkalvenschraut(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/10877/headopened View on GitHub

Showing 2 changed files with 27 additions and 2 deletions.

x
0 of 2 viewed, 2 left
1 addition and 1 deletionapps/server/src/provider/Layers/CodexProvider.tsModified
View file
@@ -648,7 +648,7 @@
const snapshot = probeResult.success.value;
const accountStatus = accountProbeStatus(snapshot.account);
const usageLimits =
- snapshot.account.account?.type === "apiKey"
+ snapshot.account.account?.type === "apiKey" || !snapshot.account.requiresOpenaiAuth
? makeUnavailableUsageLimits({ checkedAt, reason: "unsupported" })
: snapshot.rateLimits === undefined || "failure" in snapshot.rateLimits
? makeUnavailableUsageLimits({
26 additions and 1 deletionapps/server/src/provider/Layers/ProviderRegistry.test.tsModified
View file
@@ -299,7 +299,7 @@
email: "test@example.com",
planType: "pro",
- requiresOpenaiAuth: false,
+ requiresOpenaiAuth: true,
models: [
@@ -365,6 +365,31 @@
"ProviderRegistry",
(it) => {
describe("checkCodexProviderStatus", () => {
+ it.effect("does not count proxy rate limits as a native subscription", () =>
+ Effect.gen(function* () {
+ for (const account of [