From 54cb311f40172fac5501038e4b5a986d16a6af66 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 5 Apr 2026 11:44:40 -0700 Subject: [PATCH] fix: suppress false 'Unknown toolsets' warning for MCP server names (#5279) MCP server names (e.g. annas, libgen) are added to enabled_toolsets by _get_platform_tools() but aren't registered in TOOLSETS until later when _sync_mcp_toolsets() runs during tool discovery. The validation in HermesCLI.__init__() fires before that, producing a false warning. Fix: exclude configured MCP server names from the validation check. CLI_CONFIG is already available at the call site, so no new imports needed. Closes #5267 (alternative fix) --- cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli.py b/cli.py index 096ab9ec4..883258d0c 100644 --- a/cli.py +++ b/cli.py @@ -1257,8 +1257,11 @@ class HermesCLI: # Parse and validate toolsets self.enabled_toolsets = toolsets if toolsets and "all" not in toolsets and "*" not in toolsets: - # Validate each toolset - invalid = [t for t in toolsets if not validate_toolset(t)] + # Validate each toolset — MCP server names are added by + # _get_platform_tools() but aren't registered in TOOLSETS yet + # (that happens later in _sync_mcp_toolsets), so exclude them. + mcp_names = set((CLI_CONFIG.get("mcp_servers") or {}).keys()) + invalid = [t for t in toolsets if not validate_toolset(t) and t not in mcp_names] if invalid: self.console.print(f"[bold red]Warning: Unknown toolsets: {', '.join(invalid)}[/]")