fix(mcp): clear prompt registry on refresh to prevent duplicates (#5385)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
This commit is contained in:
Ramón Medrano Llamas
2025-08-05 23:59:31 +02:00
committed by GitHub
parent faf6a5497a
commit 29c3825604
3 changed files with 40 additions and 12 deletions

View File

@@ -172,6 +172,10 @@ describe('ToolRegistry', () => {
);
vi.spyOn(config, 'getMcpServers');
vi.spyOn(config, 'getMcpServerCommand');
vi.spyOn(config, 'getPromptRegistry').mockReturnValue({
clear: vi.fn(),
removePromptsByServer: vi.fn(),
} as any);
mockDiscoverMcpTools.mockReset().mockResolvedValue(undefined);
});
@@ -353,7 +357,7 @@ describe('ToolRegistry', () => {
mcpServerConfigVal,
undefined,
toolRegistry,
undefined,
config.getPromptRegistry(),
false,
);
});
@@ -376,7 +380,7 @@ describe('ToolRegistry', () => {
mcpServerConfigVal,
undefined,
toolRegistry,
undefined,
config.getPromptRegistry(),
false,
);
});