From 631e8793f4bfff80ce9ed45dfac1bd5870c92559 Mon Sep 17 00:00:00 2001 From: pefontana Date: Wed, 15 Apr 2026 16:17:36 -0300 Subject: [PATCH] refactor(delegate): drop dead default_toolsets from CLI default config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit delegation.default_toolsets was declared in cli.py's CLI_CONFIG default dict and documented in cli-config.yaml.example, but never read: none of tools/delegate_tool.py, _load_config(), or any call site ever looked it up. The live fallback is the DEFAULT_TOOLSETS module constant at tools/delegate_tool.py:101, which stays as-is. hermes_cli/config.py's DEFAULT_CONFIG["delegation"] already omits the key — this commit aligns cli.py with that. Adds a regression test in tests/hermes_cli/test_config_drift.py so a future refactor that re-adds the key without wiring it up to _load_config() fails loudly. Part of Initiative 2 / M0.5. --- cli.py | 1 - tests/hermes_cli/test_config_drift.py | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/hermes_cli/test_config_drift.py diff --git a/cli.py b/cli.py index 1ba5071ed..05015752a 100644 --- a/cli.py +++ b/cli.py @@ -371,7 +371,6 @@ def load_cli_config() -> Dict[str, Any]: }, "delegation": { "max_iterations": 45, # Max tool-calling turns per child agent - "default_toolsets": ["terminal", "file", "web"], # Default toolsets for subagents "model": "", # Subagent model override (empty = inherit parent model) "provider": "", # Subagent provider override (empty = inherit parent provider) "base_url": "", # Direct OpenAI-compatible endpoint for subagents diff --git a/tests/hermes_cli/test_config_drift.py b/tests/hermes_cli/test_config_drift.py new file mode 100644 index 000000000..4b49c58b1 --- /dev/null +++ b/tests/hermes_cli/test_config_drift.py @@ -0,0 +1,25 @@ +"""Regression tests for removed dead config keys. + +This file guards against accidental re-introduction of config keys that were +documented or declared at some point but never actually wired up to read code. +Future dead-config regressions can accumulate here. +""" + + +def test_delegation_default_toolsets_removed_from_cli_config(): + """delegation.default_toolsets was dead config — never read by + _load_config() or anywhere else. Removed in M0.5. + + Guards against accidental re-introduction in cli.py's CLI_CONFIG default + dict. If this test fails, someone re-added the key without wiring it up + to _load_config() in tools/delegate_tool.py. + """ + from cli import CLI_CONFIG + + delegation_cfg = CLI_CONFIG.get("delegation", {}) + assert "default_toolsets" not in delegation_cfg, ( + "delegation.default_toolsets was removed in M0.5 because it was " + "never read. Do not re-add it; use tools/delegate_tool.py's " + "DEFAULT_TOOLSETS module constant or wire a new config key through " + "_load_config()." + )