Compare commits

...

1 Commits

Author SHA1 Message Date
Teknium
736c6175b9 fix: suppress false 'Unknown toolsets' warning for MCP server names
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)
2026-04-05 11:41:15 -07:00

7
cli.py
View File

@@ -1257,8 +1257,11 @@ class HermesCLI:
# Parse and validate toolsets # Parse and validate toolsets
self.enabled_toolsets = toolsets self.enabled_toolsets = toolsets
if toolsets and "all" not in toolsets and "*" not in toolsets: if toolsets and "all" not in toolsets and "*" not in toolsets:
# Validate each toolset # Validate each toolset — MCP server names are added by
invalid = [t for t in toolsets if not validate_toolset(t)] # _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: if invalid:
self.console.print(f"[bold red]Warning: Unknown toolsets: {', '.join(invalid)}[/]") self.console.print(f"[bold red]Warning: Unknown toolsets: {', '.join(invalid)}[/]")