fix: strip tool progress display modes

This commit is contained in:
devatnull 2026-06-29 08:03:04 +03:00 committed by Teknium
parent fddc95f4c2
commit 46fbd73f66
2 changed files with 7 additions and 1 deletions

View file

@ -233,7 +233,7 @@ def _normalise(setting: str, value: Any) -> Any:
return "off"
if value is True:
return "all"
val = str(value).lower()
val = str(value).strip().lower()
return val if val in {"off", "new", "all", "verbose"} else "all"
if setting in {
"show_reasoning",

View file

@ -155,6 +155,12 @@ class TestYAMLNormalisation:
config = {"display": {"platforms": {"whatsapp": {"tool_progress": "generic"}}}}
assert resolve_display_setting(config, "whatsapp", "tool_progress") == "all"
def test_tool_progress_mode_strips_whitespace(self):
from gateway.display_config import resolve_display_setting
config = {"display": {"platforms": {"whatsapp": {"tool_progress": " off\n"}}}}
assert resolve_display_setting(config, "whatsapp", "tool_progress") == "off"
def test_only_long_running_visibility_accepts_generic_mode(self):
from gateway.display_config import resolve_display_setting