Perf: skip MCP/LSP runtime spawning when no servers are configured
This commit is contained in:
parent
80e681a60c
commit
e6c6aaa11b
@ -288,6 +288,10 @@ export async function createBundleLspToolRuntime(params: {
|
||||
for (const diagnostic of loaded.diagnostics) {
|
||||
logWarn(`bundle-lsp: ${diagnostic.pluginId}: ${diagnostic.message}`);
|
||||
}
|
||||
// Skip spawning when no LSP servers are configured.
|
||||
if (Object.keys(loaded.lspServers).length === 0) {
|
||||
return { tools: [], sessions: [], dispose: async () => {} };
|
||||
}
|
||||
|
||||
const reservedNames = new Set(
|
||||
Array.from(params.reservedToolNames ?? [], (name) => name.trim().toLowerCase()).filter(Boolean),
|
||||
|
||||
@ -131,6 +131,10 @@ export async function createBundleMcpToolRuntime(params: {
|
||||
for (const diagnostic of loaded.diagnostics) {
|
||||
logWarn(`bundle-mcp: ${diagnostic.pluginId}: ${diagnostic.message}`);
|
||||
}
|
||||
// Skip spawning when no MCP servers are configured.
|
||||
if (Object.keys(loaded.mcpServers).length === 0) {
|
||||
return { tools: [], dispose: async () => {} };
|
||||
}
|
||||
|
||||
const reservedNames = new Set(
|
||||
Array.from(params.reservedToolNames ?? [], (name) => name.trim().toLowerCase()).filter(Boolean),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user