mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-19 17:24:57 +02:00
ui: skip MCP init when no policy-enabled server remains
Extends the category-level check: the flow also skips MCP init when every globally-enabled server has its server-scoped group key disabled in the tool policy. Assisted-by: pi
This commit is contained in:
committed by
GitHub
parent
473d4a3faf
commit
0de27be4fa
@@ -329,9 +329,15 @@ class AgenticStore {
|
||||
const disabledToolCategories = new Set(
|
||||
toolPolicy?.disabledToolCategories ?? toolsStore.disabledToolCategories
|
||||
);
|
||||
// skip MCP init when the policy disables the whole MCP category
|
||||
// skip MCP init when the policy leaves no usable server: either the whole
|
||||
// MCP category is off, or every globally-enabled server has its group key
|
||||
// disabled for this flow
|
||||
const hasMcpServers =
|
||||
mcpStore.hasEnabledServers() && !disabledToolCategories.has(ToolSource.MCP);
|
||||
mcpStore.hasEnabledServers() &&
|
||||
!disabledToolCategories.has(ToolSource.MCP) &&
|
||||
mcpStore
|
||||
.getServers()
|
||||
.some((s) => s.enabled && !disabledTools.has(toolsStore.getMcpServerToolsKey(s.id)));
|
||||
|
||||
if (hasMcpServers) {
|
||||
const initialized = await mcpStore.ensureInitialized();
|
||||
|
||||
Reference in New Issue
Block a user