diff --git a/gateway/display_config.py b/gateway/display_config.py index aebda8cd8ba..8498c1df166 100644 --- a/gateway/display_config.py +++ b/gateway/display_config.py @@ -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", diff --git a/tests/gateway/test_display_config.py b/tests/gateway/test_display_config.py index f95c8bdb496..4f2848eacdd 100644 --- a/tests/gateway/test_display_config.py +++ b/tests/gateway/test_display_config.py @@ -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