fix(tools): disabled toolsets re-enable themselves after hermes tools#2268
Merged
fix(tools): disabled toolsets re-enable themselves after hermes tools#2268
Conversation
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.
This was referenced Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Disabling a toolset via
hermes toolsdoesn't persist. The next time you openhermes tools, everything is checked again.Root cause (two bugs)
Bug 1 — save preserves composite toolsets:
_save_platform_toolspreserved entries not inconfigurable_keys. Composite toolsets likehermes-cliaren't configurable keys, so they survived every save. Sincehermes-cliincludes 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_toolsresolved all saved entries to individual tool names, then checked which configurable toolsets were subsets. Sincehermes-clicontributed 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
TOOLSETSkeys from preserved entries. Only truly unknown entries (MCP server names) are kept. Composites likehermes-cliare 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