Skip to content

Commit 5a4461a

Browse files
jakeleventhalclaude
andcommitted
fix(fx): a backend with unreadable sign-in no longer hides a signed-in one
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 9f2de64 commit 5a4461a

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎packages/provider-fx/src/server/status.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,19 @@ describe("checkFxProviderStatus", () => {
163163
draft.models.map((model) => model.slug),
164164
["default", "codex:gpt-5.5"],
165165
);
166+
167+
// An earlier backend whose sign-in fx could not report does not hide Codex's.
168+
const unreadable = yield* check({
169+
" status --json": status("missing", { model: "spacexai/grok-4.7" }),
170+
"gateway models --json": GATEWAY_MODELS,
171+
"codex status --json": status("chatgpt subscription"),
172+
"codex models --json": models(["gpt-5.5"]),
173+
"grok status --json": status("missing"),
174+
});
175+
assert.deepEqual(unreadable.draft.auth, {
176+
status: "authenticated",
177+
label: "Codex subscription",
178+
});
166179
}),
167180
);
168181

‎packages/provider-fx/src/server/status.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,11 @@ export const checkFxProviderStatus = Effect.fn("checkFxProviderStatus")(function
338338
(backend) => backend.id === fxStatusBackend(status?.model_source),
339339
);
340340
const usable = backends.find((backend) => backend.signedIn !== false && backend.models?.length);
341+
const signedIn = backends.find((backend) => backend.signedIn === true);
341342
const statusAuth = fxAuth(status?.auth);
342343
const auth: ServerProviderAuth =
343-
statusAuth.status !== "authenticated" && usable?.signedIn === true
344-
? { status: "authenticated", label: usable.name }
344+
statusAuth.status !== "authenticated" && signedIn !== undefined
345+
? { status: "authenticated", label: signedIn.name }
345346
: statusAuth;
346347
const probe =
347348
auth.status === "unauthenticated"

0 commit comments

Comments
 (0)