diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index 343007cabc..d815c969cb 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -475,7 +475,12 @@ def _get_platform_tools( toolset_names = platform_toolsets.get(platform) if toolset_names is None or not isinstance(toolset_names, list): - default_ts = PLATFORMS[platform]["default_toolset"] + plat_info = PLATFORMS.get(platform) + if plat_info: + default_ts = plat_info["default_toolset"] + else: + # Plugin platform — derive toolset name from platform key + default_ts = f"hermes-{platform}" toolset_names = [default_ts] # YAML may parse bare numeric names (e.g. ``12306:``) as int. diff --git a/toolsets.py b/toolsets.py index 57e03d2500..658e1c3487 100644 --- a/toolsets.py +++ b/toolsets.py @@ -452,6 +452,28 @@ def resolve_toolset(name: str, visited: Set[str] = None) -> List[str]: return [e.name for e in registry._tools.values() if e.toolset == name] except Exception: pass + + # Auto-generate a toolset for plugin platforms (hermes-). + # Gives them _HERMES_CORE_TOOLS plus any tools the plugin registered + # into a toolset matching the platform name. + if name.startswith("hermes-"): + platform_name = name[len("hermes-"):] + try: + from gateway.platform_registry import platform_registry + if platform_registry.is_registered(platform_name): + plugin_tools = set(_HERMES_CORE_TOOLS) + try: + from tools.registry import registry + plugin_tools.update( + e.name for e in registry._tools.values() + if e.toolset == platform_name + ) + except Exception: + pass + return list(plugin_tools) + except Exception: + pass + return [] # Collect direct tools