The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(petdex): quoted 'false' now disables display.pet.enabled everywhere
thatssoheil9e8828999d5e
diff --git a/tests/test_tui_gateway_server.py b/tests/test_tui_gateway_server.pyindex c144f09c594..b0b24d6e87a 100644--- a/tests/test_tui_gateway_server.py+++ b/tests/test_tui_gateway_server.py@@ -6778,6 +6778,27 @@ def test_config_set_approval_mode_persists_three_way_value_and_emits_live_statusassert emitted[0][2]["approval_mode"] == "manual"+def test_pet_gallery_quoted_false_enabled_reports_disabled(tmp_path, monkeypatch):+ """display.pet.enabled: "false" (quoted) must report enabled=False.++ The old check was bool(value) — bool('false') is True, so a hand-edited+ quoted YAML value kept the petdex mascot enabled against the operator's+ explicit intent.+ """+ import yaml++ monkeypatch.setattr(server, "_hermes_home", tmp_path)+ monkeypatch.setenv("HERMES_HOME", str(tmp_path))+ (tmp_path / "config.yaml").write_text(+ yaml.safe_dump({"display": {"pet": {"enabled": "false"}}})+ )++ response = server.handle_request(+ {"id": "1", "method": "pet.gallery", "params": {}}+ )+ assert response["result"]["enabled"] is False++def test_desktop_contract_includes_approval_mode_rpc():assert server.DESKTOP_BACKEND_CONTRACT >= 3diff --git a/tui_gateway/methods_session.py b/tui_gateway/methods_session.pyindex a05b303486d..868322156d2 100644--- a/tui_gateway/methods_session.py+++ b/tui_gateway/methods_session.py@@ -1516,7 +1516,7 @@ def _(rid, params: dict) -> dict:except Exception:pet_cfg = {}- if not bool(pet_cfg.get("enabled")):+ if not is_truthy_value(pet_cfg.get("enabled"), default=False):return _ok(rid, {"enabled": False})pet = store.resolve_active_pet(str(pet_cfg.get("slug", "") or ""))@@ -1669,7 +1669,7 @@ def _(rid, params: dict) -> dict:return _ok(rid,{- "enabled": bool(pet_cfg.get("enabled")),+ "enabled": is_truthy_value(pet_cfg.get("enabled"), default=False),"active": str(pet_cfg.get("slug", "") or ""),"pets": gallery,},diff --git a/tui_gateway/server.py b/tui_gateway/server.pyindex 44bc5663842..9a05c1ee4fc 100644--- a/tui_gateway/server.py+++ b/tui_gateway/server.py@@ -8737,7 +8737,7 @@ def _pet_active_selection():except Exception:pet_cfg = {}- enabled = bool(pet_cfg.get("enabled"))+ enabled = is_truthy_value(pet_cfg.get("enabled"), default=False)configured_slug = str(pet_cfg.get("slug", "") or "")pet = store.resolve_active_pet(configured_slug) if enabled else Nonescale = float(pet_cfg.get("scale", constants.DEFAULT_SCALE) or constants.DEFAULT_SCALE)