mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-28 18:19:28 +00:00
fix: use canonical _get_platform_tools resolver for memory tool status
The PR's inline toolset resolution (checking 'memory' in cli_toolsets list) produced wrong results for composite toolsets like 'hermes-cli' which expand to include the memory tool. Replace with the canonical _get_platform_tools() from tools_config.py which correctly handles composite toolsets and all edge cases. Update tests to mock _get_platform_tools instead of raw config.
This commit is contained in:
parent
c82c5786f4
commit
97d51ca20d
2 changed files with 26 additions and 19 deletions
|
|
@ -428,15 +428,11 @@ def cmd_status(args) -> None:
|
|||
mem_mark = "enabled ✓" if memory_enabled else "disabled ✗"
|
||||
user_mark = "enabled ✓" if user_profile_enabled else "disabled ✗"
|
||||
|
||||
# Check if the memory toolset is enabled for the CLI platform
|
||||
# platform_toolsets.cli is either None (default = all enabled) or
|
||||
# an explicit list of enabled toolset names.
|
||||
platform_toolsets = config.get("platform_toolsets", {}) or {}
|
||||
cli_toolsets = platform_toolsets.get("cli")
|
||||
memory_tool_enabled = (
|
||||
cli_toolsets is None
|
||||
or (isinstance(cli_toolsets, list) and "memory" in cli_toolsets)
|
||||
)
|
||||
# Check if the memory tool is enabled for the CLI platform via the
|
||||
# canonical resolver (handles composite toolsets like hermes-cli).
|
||||
from hermes_cli.tools_config import _get_platform_tools
|
||||
cli_tools = _get_platform_tools(config, "cli", include_default_mcp_servers=False)
|
||||
memory_tool_enabled = "memory" in cli_tools
|
||||
tool_mark = "enabled ✓" if memory_tool_enabled else "disabled ✗"
|
||||
|
||||
print("\nMemory status\n" + "─" * 40)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue