From 3c57eaf7442bba1c6d81c8f07c7436e1dd96ac2a Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:58:50 -0700 Subject: [PATCH] fix: YAML boolean handling for tool_progress config (#3300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit YAML 1.1 parses bare `off` as boolean False, which is falsy in Python's `or` chain and silently falls through to the 'all' default. Users setting `display.tool_progress: off` in config.yaml saw no effect — tool progress stayed on. Normalise False → 'off' before the or chain in both affected paths: - gateway/run.py _run_agent() tool progress reader - cli.py HermesCLI.__init__() tool_progress_mode Reported by @gibbsoft in #2859. Closes #2859. --- cli.py | 4 +++- gateway/run.py | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cli.py b/cli.py index ff81b808e..8a1d7caa8 100644 --- a/cli.py +++ b/cli.py @@ -1036,7 +1036,9 @@ class HermesCLI: self.config = CLI_CONFIG self.compact = compact if compact is not None else CLI_CONFIG["display"].get("compact", False) # tool_progress: "off", "new", "all", "verbose" (from config.yaml display section) - self.tool_progress_mode = CLI_CONFIG["display"].get("tool_progress", "all") + # YAML 1.1 parses bare `off` as boolean False — normalise to string. + _raw_tp = CLI_CONFIG["display"].get("tool_progress", "all") + self.tool_progress_mode = "off" if _raw_tp is False else str(_raw_tp) # resume_display: "full" (show history) | "minimal" (one-liner only) self.resume_display = CLI_CONFIG["display"].get("resume_display", "full") # bell_on_complete: play terminal bell (\a) when agent finishes a response diff --git a/gateway/run.py b/gateway/run.py index 25e51af7a..4ca1dda03 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -4805,9 +4805,14 @@ class GatewayRunner: enabled_toolsets = sorted(_get_platform_tools(user_config, platform_key)) # Tool progress mode from config.yaml: "all", "new", "verbose", "off" - # Falls back to env vars for backward compatibility + # Falls back to env vars for backward compatibility. + # YAML 1.1 parses bare `off` as boolean False — normalise before + # the `or` chain so it doesn't silently fall through to "all". + _raw_tp = user_config.get("display", {}).get("tool_progress") + if _raw_tp is False: + _raw_tp = "off" progress_mode = ( - user_config.get("display", {}).get("tool_progress") + _raw_tp or os.getenv("HERMES_TOOL_PROGRESS_MODE") or "all" )