Accurate tool counting with platform toolsets
Cluster 41445 · agent. Data as of
1 open item. Fix merged in #59210 on 6 Jul 2026. Check it covers your case.
The short answer
- Known?
- Yes. 6 related items grouped here, 1 issue already closed.
- Fix event
- A fix was merged to main in PR #59210. Check it covers your case. No release data is tracked.
- Tracker
- The maintainers' tracker marks this
resolved, deciding PR #59210. That is separate from the fix event. - Still open
- 0 issues and 1 PR.
These changes correct prompt-size diagnostics that over-counted tools by ignoring enabled/disabled state and platform-specific toolset resolution. A related change ensures string-typed toolset lists are coerced to proper lists rather than iterated as individual characters.
Open issues0
Open PRs1
- PR#57167fix(prompt-size): honor effective Hermes toolsets
Fixes on record
-
#59210 fix(prompt-size): pass platform-resolved toolsets into the inspection agent
files:
hermes_cli/prompt_size.py,scripts/release.py,tests/hermes_cli/test_prompt_size.pyShow the diff
-
hermes_cli/prompt_size.py@@ -34,11 +34,17 @@ def _build_inspection_agent(platform: str) -> Any: """ from run_agent import AIAgent from hermes_cli.config import load_config + from hermes_cli.tools_config import _get_platform_tools cfg = load_config() model_cfg = cfg.get("model", {}) if isinstance(cfg.get("model"), dict) else {} model = model_cfg.get("default") or model_cfg.get("model") or "" + # Resolve platform-specific toolsets the same way the gateway does. + enabled_toolsets = sorted(_get_platform_tools(cfg, platform)) + agent_cfg = cfg.get("agent") or {} + disabled_toolsets = agent_cfg.get("disabled_toolsets") or None + return AIAgent( model=model, api_key="[redacted:secret-assignment]", @@ -46,6 +52,8 @@ def _build_inspection_agent(platform: str) -> Any: quiet_mode=True, save_trajectories=False, platform=platform, + enabled_toolsets=enabled_toolsets, + disabled_toolsets=disabled_toolsets, ) -
scripts/release.py@@ -896,6 +896,7 @@ "[redacted:email]": "JezzaHehn", "[redacted:email]": "JezzaHehn", "[email protected]": "dodo-reach", + "[redacted:email]": "EdderTalmor", # PR #41575 salvage (prompt-size: pass platform-resolved enabled_toolsets + agent.disabled_toolsets into the inspection agent; #41445) "[email protected]": "Bartok9", "[email protected]": "banditburai", "[email protected]": "Kyzcreig", -
tests/hermes_cli/test_prompt_size.py@@ -1,11 +1,14 @@ """Tests for the ``hermes prompt-size`` diagnostic (issue #34667).""" import json +import sys +from types import SimpleNamespace import pytest from hermes_cli.prompt_size import ( _SKILLS_BLOCK_RE, + _build_inspection_agent, compute_prompt_breakdown, render_breakdown, ) @@ -70,6 +73,56 @@ def test_runs_offline_without_credentials(isolated_home, monkeypatch): assert data["system_prompt"]["bytes"] > 0 +def test_inspection_agent_uses_resolved_platform_toolsets(monkeypatch): + """Inspection must match real CLI tool resolution, including disables.""" + captured = {} + + class FakeAIAgent: + def __init__(self, **kwargs): + captured.update(kwargs) + + cfg = { + "model": {"default": "test/model"}, + "agent": {"disabled_toolsets": ["memory"]}, + } + + monkeypatch.setitem( + sys.modules, + "run_agent", + SimpleNamespace(AIAgent=FakeAIAgent), + ) + monkeypatch.setattr("hermes_cli.config.load_config", lambda: cfg) + monkeypatch.setattr( + "hermes_cli.tools_config._get_platform_tools", + lambda passed_cfg, platform: {"terminal", "file"}, + ) + + _build_inspection_agent("cli") + + assert captured["model"] == "test/model" + assert captured["platform"] == "cli" + assert captured["enabled_toolsets"] == ["file", "terminal"] + assert captured["disabled_toolsets"] == ["memory"] + + +def test_blank_slate_prompt_size_counts_only_minimal_tools(isolated_home): + """Blank Slate prompt-size should report file + terminal schemas only.""" + from hermes_cli.config import save_config + from hermes_cli.setup import ( + _blank_slate_minimal_toolsets, + _blank_slate_minimize_config, + ) + + cfg = {"model": {"default": "MiniMax-M2.7"}} + _blank_slate_minimal_toolsets(cfg) + _blank_slate_minimize_config(cfg) + save_config(cfg) + + data = compute_prompt_breakdown("cli") + + assert data["tools"]["count"] == 6 + + def test_skills_index_reflects_installed_skills(isolated_home): """Installing a skill makes the skills-index block non-empty.
-
3 PRs closed without merging
From the close comments: done elsewhere 2 · merged via another change 1
-
#41461 fix(cli): pass platform toolsets to prompt-size inspection agent · done elsewhere →
fe8d02c -
#52032 fix(cli): honor agent.disabled_toolsets in prompt-size diagnostic · merged via another change →
#59210,#41445,#41575,#51586 -
#65452 fix(toolsets): coerce string-typed toolset lists instead of iterating characters · done elsewhere →
309cf2c
Closed issues · 1
- Closed#41445hermes prompt-size over-counts tools by not respecting enabled/disabled toolsets
How this cluster was grouped
-
Link evidence (
structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference. -
Pairwise link density
0.33: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.
Pick up a Lab task
Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.
Open the LabAt a glance
- Subsystem
- agent
- Merged PRs
- #59210
- Closed issues
- 1
- Attempts
- 3 PRs closed without merging
- Fix link checked
- 6 Jul 2026