From a1c17edcbb33ebe66052219c94fc274340ca5165 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sat, 4 Jul 2026 13:51:26 +0530 Subject: [PATCH] test: update reasoning-effort docstring guards for new 'max' level Follow-up to salvaged #57601. Adding "max" to VALID_REASONING_EFFORTS made parse_reasoning_effort("max") valid, so: - test_unknown_levels_return_none no longer lists "max" (it is now valid; auto-covered by test_each_valid_level which iterates the tuple). - test_known_supported_levels_are_documented and the parse_reasoning_effort docstring now include "max" so the doc-sync guard actually protects it. --- hermes_constants.py | 2 +- tests/test_hermes_constants.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hermes_constants.py b/hermes_constants.py index 64331299345..29dac85fe8a 100644 --- a/hermes_constants.py +++ b/hermes_constants.py @@ -797,7 +797,7 @@ VALID_REASONING_EFFORTS = ("minimal", "low", "medium", "high", "xhigh", "max") def parse_reasoning_effort(effort) -> dict | None: """Parse a reasoning effort level into a config dict. - Valid levels: "none", "minimal", "low", "medium", "high", "xhigh". + Valid levels: "none", "minimal", "low", "medium", "high", "xhigh", "max". Returns None when the input is empty or unrecognized (caller uses default). Returns {"enabled": False} for "none" (aliases: "false", "disabled", and YAML boolean False — users write ``reasoning_effort: false``/``off``/``no`` diff --git a/tests/test_hermes_constants.py b/tests/test_hermes_constants.py index f23bed43ab8..e4b064ed947 100644 --- a/tests/test_hermes_constants.py +++ b/tests/test_hermes_constants.py @@ -473,7 +473,7 @@ class TestParseReasoningEffort: @pytest.mark.parametrize( "value", - ["bogus", "very-high", "max", "0", "off", "true", "default"], + ["bogus", "very-high", "0", "off", "true", "default"], ) def test_unknown_levels_return_none(self, value): """Unrecognized strings fall back to the caller default (None).""" @@ -482,11 +482,11 @@ class TestParseReasoningEffort: def test_known_supported_levels_are_documented(self): """Guard against silently dropping a documented level. - The docstring promises "minimal", "low", "medium", "high", "xhigh". - If someone removes one from VALID_REASONING_EFFORTS without updating - the docstring, this test will fail and force the call out. + The docstring promises "minimal", "low", "medium", "high", "xhigh", + "max". If someone removes one from VALID_REASONING_EFFORTS without + updating the docstring, this test will fail and force the call out. """ - documented = {"minimal", "low", "medium", "high", "xhigh"} + documented = {"minimal", "low", "medium", "high", "xhigh", "max"} assert documented.issubset(set(VALID_REASONING_EFFORTS))