mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
fix(prompt-size): respect enabled/disabled toolsets per platform
The `hermes prompt-size` command now uses `_get_platform_tools()` to resolve platform-specific toolsets the same way the gateway does, and also honors `agent.disabled_toolsets` from config. This fixes the discrepancy where `prompt-size` reported more tools than actually available in real sessions for a given platform. Fixes #41445.
This commit is contained in:
parent
6d359e0681
commit
fe8d02cec7
1 changed files with 8 additions and 0 deletions
|
|
@ -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="inspect-only",
|
||||
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue