Skip to content

The agent that grows with you

fix(cli): stop sending the coding posture as a toolsets pick

unsupportedpastelsaca77bf059a3
diff --git a/cli.py b/cli.py
index b3f523f67c8..0de1eafdbd9 100644
--- a/cli.py
+++ b/cli.py
@@ -1508,7 +1508,9 @@ def _build_cli_from_args(model, toolsets, provider, reasoning, api_key, base_url
for t in toolsets:
toolsets_list.extend([x.strip() for x in t.split(",")] if isinstance(t, str) else [str(t)])
elif not toolsets:
- # Coding posture inside a code workspace, else the shared platform resolver.
+ # Coding posture inside a code workspace, else the shared platform resolver. Neither is a
+ # pick: the gateway resolves both from the session's cwd, so this list only feeds the display.
+ profile_default = True
try:
from agent.coding_context import coding_selection
toolsets_list = coding_selection(platform="cli", config=CLI_CONFIG)
@@ -1517,7 +1519,6 @@ def _build_cli_from_args(model, toolsets, provider, reasoning, api_key, base_url
if toolsets_list is None:
from hermes_cli.tools_config import _get_platform_tools
toolsets_list = sorted(_get_platform_tools(CLI_CONFIG, "cli"))
- profile_default = True
parsed_skills = _parse_skills_argument(skills)
@@ -1546,7 +1547,7 @@ def _build_cli_from_args(model, toolsets, provider, reasoning, api_key, base_url
sys.exit(1)
raise
if profile_default:
- cli._explicit_toolsets = False # the gateway resolves the profile's toolsets itself
+ cli._explicit_toolsets = False # the gateway resolves the default and coding posture itself
# Only a typed -t is checked against a resumed session's frozen toolsets.
cli._typed_toolsets = toolsets_list if toolsets else None
diff --git a/tests/hermes_cli/test_cli_profile_toolsets.py b/tests/hermes_cli/test_cli_profile_toolsets.py
index 96369a3217f..7c38cc1ce2d 100644
--- a/tests/hermes_cli/test_cli_profile_toolsets.py
+++ b/tests/hermes_cli/test_cli_profile_toolsets.py
@@ -81,7 +81,8 @@ def test_explicit_unknown_toolset_is_still_refused(store, monkeypatch):
build_policy(params, CONFIG)
-def test_coding_posture_selection_still_rides_session_create(store, monkeypatch):
+def test_coding_posture_is_left_to_the_gateway(store, monkeypatch):
db, client = store
- _launch(monkeypatch, db, coding=["terminal"])
- assert _created(client)["toolsets"] == ["terminal"]
+ host, _printed = _launch(monkeypatch, db, coding=["terminal"])
+ assert host.enabled_toolsets == ["terminal"] # the local display still shows the posture
+ assert "toolsets" not in _created(client)