From 03d7fe15d59499a2e9245e0bd34a4eafa1008bac Mon Sep 17 00:00:00 2001 From: Swayam2004 Date: Sun, 23 Aug 2026 03:15:27 +0530 Subject: [PATCH] fix(web): stop phrasing unknown provider auth as a verification failure --- .../settings/providerStatus.test.ts | 41 +++++++++++++++++++ .../src/components/settings/providerStatus.ts | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 apps/web/src/components/settings/providerStatus.test.ts diff --git a/apps/web/src/components/settings/providerStatus.test.ts b/apps/web/src/components/settings/providerStatus.test.ts new file mode 100644 index 000000000000..9d2c581da58c --- /dev/null +++ b/apps/web/src/components/settings/providerStatus.test.ts @@ -0,0 +1,41 @@ +import { describe, expect, it } from "vite-plus/test"; +import { ProviderDriverKind, ProviderInstanceId } from "@t3tools/contracts"; + +import type { ServerProvider } from "@t3tools/contracts"; + +import { getProviderSummary } from "./providerStatus"; + +const makeProvider = (overrides: Partial = {}): ServerProvider => ({ + instanceId: ProviderInstanceId.make("grok"), + driver: ProviderDriverKind.make("grok"), + enabled: true, + installed: true, + version: "1.0.5", + status: "ready", + auth: { status: "unknown" }, + checkedAt: "2026-08-23T00:00:00.000Z", + models: [], + slashCommands: [], + skills: [], + ...overrides, +}); + +describe("getProviderSummary", () => { + it("does not phrase unknown auth as a failure for ready providers", () => { + const summary = getProviderSummary(makeProvider()); + expect(summary.headline).toBe("Available"); + expect(summary.detail).toBe("Installed and ready. Authentication status was not reported."); + }); + + it("prefers the server-supplied message over the fallback detail", () => { + const summary = getProviderSummary( + makeProvider({ message: "Grok CLI is ready to accept sessions." }), + ); + expect(summary.detail).toBe("Grok CLI is ready to accept sessions."); + }); + + it("still reports authenticated providers with their auth label", () => { + const summary = getProviderSummary(makeProvider({ auth: { status: "authenticated" } })); + expect(summary.headline).toContain("Authenticated"); + }); +}); diff --git a/apps/web/src/components/settings/providerStatus.ts b/apps/web/src/components/settings/providerStatus.ts index 06622a761b7e..5aa643e3ac8c 100644 --- a/apps/web/src/components/settings/providerStatus.ts +++ b/apps/web/src/components/settings/providerStatus.ts @@ -76,7 +76,7 @@ export function getProviderSummary(provider: ServerProvider | undefined) { } return { headline: "Available", - detail: provider.message ?? "Installed and ready, but authentication could not be verified.", + detail: provider.message ?? "Installed and ready. Authentication status was not reported.", }; }