fix(core): prevent MCP tool wiping on background discovery failures

This commit is contained in:
Spencer
2026-04-24 18:49:25 +00:00
parent 3dc8e7e13c
commit 83eb00719d
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -1461,8 +1461,8 @@ describe('mcp-client', () => {
// Trigger notification - should fail internally but catch the error
await notificationCallback();
// Should try to remove tools
expect(mockedToolRegistry.removeMcpToolsByServer).toHaveBeenCalled();
// Should NOT try to remove tools when discovery fails
expect(mockedToolRegistry.removeMcpToolsByServer).not.toHaveBeenCalled();
// Should NOT emit success feedback
expect(coreEvents.emitFeedback).not.toHaveBeenCalledWith(
+1
View File
@@ -1344,6 +1344,7 @@ export async function discoverTools(
error,
mcpServerName,
);
throw error;
}
return [];
}