From 820d38c438237862ad59879b8f1208486d5cac0e Mon Sep 17 00:00:00 2001 From: Cliff Hall Date: Sat, 25 Jul 2026 11:40:31 -0400 Subject: [PATCH] fix(web): render the connected header when a modern server omits serverInfo (#1773) A modern-era server/discover makes serverInfo optional (SHOULD, not MUST); a conforming modern server that omits it left initializeResult undefined, collapsing the entire connected header + tab bar so the server was uninspectable. Gate initializeResult on connectionStatus alone with a catalog-name fallback, and thread a serverInfoReported flag so the Connection Info modal reports the omission truthfully instead of presenting the inferred name as server-sent. Closes #1772. --- clients/web/src/App.test.tsx | 105 +++++++++++++++++- clients/web/src/App.tsx | 50 ++++++--- .../ConnectionInfoContent.stories.tsx | 38 ++++++- .../ConnectionInfoContent.test.tsx | 67 +++++++++++ .../ConnectionInfoContent.tsx | 34 +++++- .../ConnectionInfoModal.stories.tsx | 1 + .../ConnectionInfoModal.test.tsx | 5 + .../ConnectionInfoModal.tsx | 9 ++ 8 files changed, 288 insertions(+), 21 deletions(-) diff --git a/clients/web/src/App.test.tsx b/clients/web/src/App.test.tsx index b1d65009..ffa3daee 100644 --- a/clients/web/src/App.test.tsx +++ b/clients/web/src/App.test.tsx @@ -220,8 +220,10 @@ vi.mock("@inspector/core/react/useInspectorClient.js", () => ({ status: "connected", capabilities: {}, clientCapabilities: {}, - // Left undefined so `initializeResult` stays undefined and the - // ConnectionInfoModal (gated on it) never mounts during the test. + // Undefined models a modern server that omitted the optional serverInfo. As + // of #1772 `initializeResult` is still built when connected (with a + // catalog-name fallback), so this exercises that path — see the "#1772" + // describe block. serverInfo: undefined, instructions: undefined, })), @@ -358,7 +360,9 @@ vi.mock("./components/views/InspectorView/InspectorView", () => ({ currentLogLevel?: string; activeTab?: string; erroredServerId?: string; + initializeResult?: { serverInfo: { name: string; version: string } }; onActiveTabChange: (tab: string) => void; + onConnectionInfo: () => void; onToggleConnection: (id: string) => void; onToolsUiChange: (next: { selectedToolName?: string; @@ -425,6 +429,11 @@ vi.mock("./components/views/InspectorView/InspectorView", () => ({ {props.currentLogLevel} {props.activeTab ?? "none"} + + {props.initializeResult + ? `name:${props.initializeResult.serverInfo.name || "(empty)"}` + : "none"} + {props.erroredServerId ?? "none"} @@ -432,6 +441,9 @@ vi.mock("./components/views/InspectorView/InspectorView", () => ({ switch-servers-tab +