Skip to content

Commit 4cdd98b

Browse files
committed
fix: keep probe failure for logged-out Codex
1 parent a7598ad commit 4cdd98b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/server/src/provider/CodexProvider.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,8 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
741741
: accountProbeStatus(snapshot);
742742
const usageLimits =
743743
// Only a ChatGPT login has quotas; a custom model provider runs with no account.
744-
!snapshot.account.account || snapshot.account.account.type === "apiKey"
744+
(!snapshot.account.account && !snapshot.account.requiresOpenaiAuth) ||
745+
snapshot.account.account?.type === "apiKey"
745746
? makeUnavailableUsageLimits({ checkedAt, reason: "unsupported" })
746747
: snapshot.rateLimits === undefined || "failure" in snapshot.rateLimits
747748
? makeUnavailableUsageLimits({

‎apps/server/src/provider/ProviderRegistry.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ it.layer(
506506
status.message,
507507
"Codex CLI is not authenticated. Run `codex login` and try again.",
508508
);
509+
assert.strictEqual(status.usageLimits?.unavailable?.reason, "probeFailed");
509510
}),
510511
);
511512

0 commit comments

Comments
 (0)