From b6b87dedd4acdee8d8dca32062fc45edcb049a69 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:31:17 -0700 Subject: [PATCH] fix: discover plugins before reading plugin toolsets in tools_config (#3457) hermes tools and _get_platform_tools() call get_plugin_toolsets() / _get_plugin_toolset_keys() without first ensuring plugins have been discovered. discover_plugins() only runs as a side effect of importing model_tools.py, which hermes tools never does. This means: - hermes tools TUI never shows plugin toolsets (invisible to users) - _get_platform_tools() in standalone processes misses plugin toolsets Fix: call discover_plugins() (idempotent) in both _get_plugin_toolset_keys() and _get_effective_configurable_toolsets() before accessing plugin state. In the gateway/CLI where model_tools.py is already imported, the call is a no-op (discover_and_load checks _discovered flag). --- hermes_cli/tools_config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index 0f5390c87..b92139039 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -108,7 +108,8 @@ def _get_effective_configurable_toolsets(): """ result = list(CONFIGURABLE_TOOLSETS) try: - from hermes_cli.plugins import get_plugin_toolsets + from hermes_cli.plugins import discover_plugins, get_plugin_toolsets + discover_plugins() # idempotent — ensures plugins are loaded result.extend(get_plugin_toolsets()) except Exception: pass @@ -118,7 +119,8 @@ def _get_effective_configurable_toolsets(): def _get_plugin_toolset_keys() -> set: """Return the set of toolset keys provided by plugins.""" try: - from hermes_cli.plugins import get_plugin_toolsets + from hermes_cli.plugins import discover_plugins, get_plugin_toolsets + discover_plugins() # idempotent — ensures plugins are loaded return {ts_key for ts_key, _, _ in get_plugin_toolsets()} except Exception: return set()