From 2c28d9f5604e989f99661de2e06633a922862f16 Mon Sep 17 00:00:00 2001 From: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com> Date: Thu, 26 Feb 2026 23:43:38 +0300 Subject: [PATCH] fix(cli): respect explicit --max-turns value even when it equals default max_turns used 60 as both the default and the sentinel to detect whether the user passed the flag. This meant `--max-turns 60` was indistinguishable from "not passed", so the env var HERMES_MAX_ITERATIONS would silently override the explicit CLI value. Change the default to None so any user-supplied value takes priority. --- cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli.py b/cli.py index 10d43ea7c..d7bbde9f6 100755 --- a/cli.py +++ b/cli.py @@ -742,14 +742,14 @@ class HermesCLI: provider: str = None, api_key: str = None, base_url: str = None, - max_turns: int = 60, + max_turns: int = None, verbose: bool = False, compact: bool = False, resume: str = None, ): """ Initialize the Hermes CLI. - + Args: model: Model to use (default: from env or claude-sonnet) toolsets: List of toolsets to enable (default: all) @@ -792,7 +792,7 @@ class HermesCLI: self._nous_key_expires_at: Optional[str] = None self._nous_key_source: Optional[str] = None # Max turns priority: CLI arg > env var > config file (agent.max_turns or root max_turns) > default - if max_turns != 60: # CLI arg was explicitly set + if max_turns is not None: self.max_turns = max_turns elif os.getenv("HERMES_MAX_ITERATIONS"): self.max_turns = int(os.getenv("HERMES_MAX_ITERATIONS")) @@ -2642,7 +2642,7 @@ def main( provider: str = None, api_key: str = None, base_url: str = None, - max_turns: int = 60, + max_turns: int = None, verbose: bool = False, compact: bool = False, list_tools: bool = False,