fix(core): reduce intrusive MCP errors and deduplicate diagnostics (#20232)

This commit is contained in:
Spencer
2026-02-27 15:04:36 -05:00
committed by GitHub
parent 6a0f4d3bdd
commit 20d884da2f
20 changed files with 626 additions and 191 deletions

View File

@@ -47,6 +47,7 @@ describe('McpStatus', () => {
isPersistentDisabled: false,
},
},
errors: {},
discoveryInProgress: false,
connectingServers: [],
showDescriptions: true,
@@ -208,6 +209,18 @@ describe('McpStatus', () => {
unmount();
});
it('renders correctly with a server error', async () => {
const { lastFrame, unmount, waitUntilReady } = render(
<McpStatus
{...baseProps}
errors={{ 'server-1': 'Failed to connect to server' }}
/>,
);
await waitUntilReady();
expect(lastFrame()).toMatchSnapshot();
unmount();
});
it('truncates resources when exceeding limit', async () => {
const manyResources = Array.from({ length: 25 }, (_, i) => ({
serverName: 'server-1',

View File

@@ -26,6 +26,7 @@ interface McpStatusProps {
serverStatus: (serverName: string) => MCPServerStatus;
authStatus: HistoryItemMcpStatus['authStatus'];
enablementState: HistoryItemMcpStatus['enablementState'];
errors: Record<string, string>;
discoveryInProgress: boolean;
connectingServers: string[];
showDescriptions: boolean;
@@ -41,6 +42,7 @@ export const McpStatus: React.FC<McpStatusProps> = ({
serverStatus,
authStatus,
enablementState,
errors,
discoveryInProgress,
connectingServers,
showDescriptions,
@@ -195,6 +197,14 @@ export const McpStatus: React.FC<McpStatusProps> = ({
<Text> ({toolCount} tools cached)</Text>
)}
{errors[serverName] && (
<Box marginLeft={2}>
<Text color={theme.status.error}>
Error: {errors[serverName]}
</Text>
</Box>
)}
{showDescriptions && server?.description && (
<Text color={theme.text.secondary}>
{server.description.trim()}

View File

@@ -60,6 +60,18 @@ A test server
"
`;
exports[`McpStatus > renders correctly with a server error 1`] = `
"Configured MCP servers:
🟢 server-1 - Ready (1 tool)
Error: Failed to connect to server
A test server
Tools:
- tool-1
A test tool
"
`;
exports[`McpStatus > renders correctly with authenticated OAuth status 1`] = `
"Configured MCP servers: