The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix: render dict-form reasoning_effort in the TUI config.get and setup wizard readers
teknium1f75263f811a1
diff --git a/hermes_cli/setup.py b/hermes_cli/setup.pyindex 62bc64e8aba..f2fcf3c8a72 100644--- a/hermes_cli/setup.py+++ b/hermes_cli/setup.py@@ -60,9 +60,14 @@ def _sub_dict(parent: dict, key: str) -> dict:def _current_reasoning_effort(config: dict) -> str:agent_cfg = config.get("agent")- if isinstance(agent_cfg, dict):- return str(agent_cfg.get("reasoning_effort") or "").strip().lower()- return ""+ if not isinstance(agent_cfg, dict):+ return ""+ effort = agent_cfg.get("reasoning_effort")+ if isinstance(effort, dict): # {enabled, effort} form: the tier name, never str(dict)+ from hermes_constants import parse_reasoning_effort+ parsed = parse_reasoning_effort(effort) or {}+ effort = "none" if parsed.get("enabled") is False else parsed.get("effort")+ return str(effort or "").strip().lower()def _set_reasoning_effort(config: dict, effort: str) -> None:diff --git a/tests/hermes_cli/test_reasoning_effort_menu.py b/tests/hermes_cli/test_reasoning_effort_menu.pyindex 84bf4920608..77741edad15 100644--- a/tests/hermes_cli/test_reasoning_effort_menu.py+++ b/tests/hermes_cli/test_reasoning_effort_menu.py@@ -1,4 +1,5 @@from hermes_cli.main_provider_setup import _prompt_reasoning_effort_selection+from hermes_cli.setup import _current_reasoning_effortdef test_reasoning_menu_orders_minimal_before_low(monkeypatch):@@ -23,3 +24,11 @@ def test_reasoning_menu_orders_minimal_before_low(monkeypatch):"medium ← currently in use","high",]+++def test_current_reasoning_effort_reads_dict_form():+ """The setup wizard's "currently in use" lookup must see the dict form's tier (or `none`+ when it disables thinking), never `str(dict)`."""+ assert _current_reasoning_effort({"agent": {"reasoning_effort": {"enabled": True, "effort": "Thinking"}}}) == "thinking"+ assert _current_reasoning_effort({"agent": {"reasoning_effort": {"enabled": False}}}) == "none"+ assert _current_reasoning_effort({"agent": {"reasoning_effort": "high"}}) == "high"diff --git a/tests/tui_gateway/test_tui_gateway_server.py b/tests/tui_gateway/test_tui_gateway_server.pyindex 07c2b8fd2cb..fff90101a93 100644--- a/tests/tui_gateway/test_tui_gateway_server.py+++ b/tests/tui_gateway/test_tui_gateway_server.py@@ -9681,6 +9681,19 @@ def test_complete_slash_leaves_argument_stages_alone(monkeypatch):assert [item["text"] for item in items] == ["collapsed", "cycle"]+def test_config_get_reasoning_renders_dict_form_custom_tier(tmp_path, monkeypatch):+ """`agent.reasoning_effort: {enabled: true, effort: thinking}` (a provider's bespoke tier)+ must read back as the tier name, not `str(dict)`."""+ monkeypatch.setattr(server, "_hermes_home", tmp_path)+ (tmp_path / "config.yaml").write_text(+ "agent:\n reasoning_effort:\n enabled: true\n effort: thinking\n", encoding="utf-8"+ )++ resp = server.handle_request({"id": "1", "method": "config.get", "params": {"key": "reasoning"}})++ assert resp["result"]["value"] == "thinking"++def test_config_set_reasoning_updates_live_session_and_agent(tmp_path, monkeypatch):monkeypatch.setattr(server, "_hermes_home", tmp_path)(tmp_path / "config.yaml").write_text("agent:\n reasoning_effort: medium\n", encoding="utf-8")diff --git a/tui_gateway/methods_config.py b/tui_gateway/methods_config.pyindex 5dd1df090af..54f7292c7c7 100644--- a/tui_gateway/methods_config.py+++ b/tui_gateway/methods_config.py@@ -159,6 +159,10 @@ def _cfg_get_reasoning(params):effort = str(reasoning_config.get("effort") or "medium") if enabled else "none"else:raw_effort = (cfg.get("agent") or {}).get("reasoning_effort", "")+ if isinstance(raw_effort, dict): # {enabled, effort} form: render the tier, never str(dict)+ from hermes_constants import parse_reasoning_effort+ parsed = parse_reasoning_effort(raw_effort) or {}+ raw_effort = False if parsed.get("enabled") is False else parsed.get("effort")# YAML `reasoning_effort: false` means thinking disabled, not "unset".effort = "none" if raw_effort is False else str(raw_effort or "medium")display = "show" if (cfg.get("display") or {}).get("show_reasoning", True) else "hide"diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.mdindex 48c73d7eb68..04c881e30c1 100644--- a/website/docs/user-guide/configuration.md+++ b/website/docs/user-guide/configuration.md@@ -1838,6 +1838,8 @@ agent:`enabled: false` in the dict form turns thinking off, the same as `reasoning_effort: none`.+The dict form is set by editing `config.yaml` directly: the `/reasoning` menus, `hermes model`, and the dashboard's auxiliary-model pickers only offer the standard ladder (the TUI status and setup wizard still show the custom tier name once it is configured).+:::noteModel ids contain dots (`claude-opus-4.5`, `qwen3.6:27b`), which `hermes config set` treats as nesting separators. Escape them with a backslash to write the literal key — `hermes config set 'agent.reasoning_overrides.ollama-local/qwen3\.6:27b-q4_k_m' low` — or edit the YAML directly. See [Dots inside key names](../reference/cli-commands.md#dots-inside-key-names).:::