Skip to content

fix(tools): disabled toolsets re-enable themselves after hermes tools#2268

Merged
teknium1 merged 3 commits intomainfrom
hermes/hermes-5d6932ba
Mar 21, 2026
Merged

fix(tools): disabled toolsets re-enable themselves after hermes tools#2268
teknium1 merged 3 commits intomainfrom
hermes/hermes-5d6932ba

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Problem

Disabling a toolset via hermes tools doesn't persist. The next time you open hermes tools, everything is checked again.

Root cause (two bugs)

Bug 1 — save preserves composite toolsets: _save_platform_tools preserved entries not in configurable_keys. Composite toolsets like hermes-cli aren't configurable keys, so they survived every save. Since hermes-cli includes all _HERMES_CORE_TOOLS (42 tools including HA, honcho, etc.), its presence in the saved list negated any individual toolset the user disabled.

Bug 2 — load uses subset inference: _get_platform_tools resolved all saved entries to individual tool names, then checked which configurable toolsets were subsets. Since hermes-cli contributed all tools, every configurable toolset appeared as a subset — so everything showed as enabled regardless of what was saved.

Fix

Save: Also filter out known TOOLSETS keys from preserved entries. Only truly unknown entries (MCP server names) are kept. Composites like hermes-cli are dropped.

Load: When the saved list contains explicit configurable keys (user has configured the platform), use direct membership instead of subset inference. Legacy configs with only a composite entry still work via the fallback path.

Test plan

python -m pytest tests/hermes_cli/test_tools_config.py tests/hermes_cli/test_tools_disable_enable.py tests/test_cli_tools_command.py -n0 -q  # 33 passed
python -m pytest tests/ -n0 -q  # 5672 passed
Test added 3 commits March 20, 2026 21:07
Cherry-picked from PR #2201 by @Gutslabs.

session_search resolved hits to parent/root sessions but only excluded
the exact current_session_id. If the active session was a child
continuation (compression/delegation), its parent could still appear
as a 'past' conversation result.

Fix: resolve current_session_id to its lineage root before filtering,
so the entire active lineage (parent and children) is excluded.
Mirrors the CLI fix for the gateway /model handler. When the user is on
a custom provider (provider=custom, localhost, or 127.0.0.1 endpoint),
/model <name> no longer tries to auto-detect a provider switch.

Previously, typing /model openrouter/nvidia/nemotron:free on Telegram
while on a localhost endpoint would silently accept the model name on
the local server — auto-detection failed to match the free model, so
the provider stayed as custom with the localhost base_url. The user saw
'Model changed' but requests still went to localhost, which doesn't
serve that model.

Now shows the endpoint URL and provider:model syntax tip, matching
the CLI behavior.
Two bugs in the save/load roundtrip for platform_toolsets:

1. _save_platform_tools preserved composite toolset entries (hermes-cli,
   hermes-telegram, etc.) because they weren't in configurable_keys.
   These composites include ALL _HERMES_CORE_TOOLS, so having hermes-cli
   in the saved list alongside individual keys negated any disables —
   the subset check always found the disabled toolset's tools via the
   composite entry.

   Fix: also filter out known TOOLSETS keys from preserved entries. Only
   truly unknown entries (MCP server names, custom entries) are kept.

2. _get_platform_tools used reverse subset inference to determine which
   configurable toolsets were enabled. This is inherently broken when
   tools appear in multiple toolsets (e.g. HA tools in both the
   homeassistant toolset and _HERMES_CORE_TOOLS).

   Fix: when the saved list contains explicit configurable keys (meaning
   the user has configured this platform), use direct membership instead
   of subset inference. The fallback path still handles legacy configs
   that only have a composite entry like hermes-cli.
@teknium1 teknium1 merged commit 52adc88 into main Mar 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant