Skip to content

Commit 8efa697

Browse files
committed
fix(copy): prioritize broken provider guidance
1 parent 569819f commit 8efa697

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎apps/web/src/components/chat/ProviderStatusBanner.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,20 @@ describe("provider status title", () => {
123123
}),
124124
).toBe("Sign in to Codex");
125125
});
126+
127+
it("keeps broken-version recovery guidance ahead of the sign-in title", () => {
128+
expect(
129+
getProviderStatusTitle({
130+
...provider,
131+
displayName: "Codex",
132+
status: "warning",
133+
auth: { status: "unauthenticated" },
134+
compatibilityAdvisory: {
135+
...provider.compatibilityAdvisory!,
136+
status: "broken",
137+
message: "This version is broken. Use 2.0.0.",
138+
},
139+
}),
140+
).toBe("Codex 1.0.0 is known to be broken");
141+
});
126142
});

‎apps/web/src/components/chat/ProviderStatusBanner.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ export function getProviderStatusMessage(status: ServerProvider): string {
9696
export function getProviderStatusTitle(status: ServerProvider): string {
9797
const providerName = status.displayName?.trim() || formatProviderDriverKindLabel(status.driver);
9898
const incompatible = getIncompatibleVersion(status);
99+
if (incompatible?.status === "broken") {
100+
return `${providerName} ${status.version ?? ""} is known to be broken`;
101+
}
99102
if (status.auth.status === "unauthenticated") return `Sign in to ${providerName}`;
100103
return incompatible
101-
? `${providerName} ${status.version ?? ""} is ${incompatible.status === "broken" ? "known to be broken" : "unsupported"}`
104+
? `${providerName} ${status.version ?? ""} is unsupported`
102105
: `${providerName} provider status`;
103106
}
104107

0 commit comments

Comments
 (0)