fix: accept max reasoning effort - #12211
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Hermes’ reasoning-effort surfaces to accept max end-to-end (shared parsing, CLI + gateway commands, menus, and user-facing docs), closing a gap where downstream adapters supported max but upstream validation rejected it.
Changes:
- Extend shared reasoning effort parsing/validation to include
maxand propagate it through CLI + gateway/reasoningflows. - Update UX surfaces (CLI command registry, reasoning effort picker ordering, docs) to list
maxas a valid option. - Add regression tests covering CLI parsing, gateway
/reasoning max, and reasoning picker ordering.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
website/docs/user-guide/features/batch-processing.md |
Documents --reasoning_effort including max. |
website/docs/user-guide/configuration.md |
Updates config docs to list max as a valid agent.reasoning_effort. |
tests/hermes_cli/test_reasoning_effort_menu.py |
Adds test ensuring menu ordering places max after xhigh. |
tests/gateway/test_reasoning_command.py |
Adds gateway regression test for /reasoning max persistence + cache update. |
tests/cli/test_reasoning_command.py |
Extends CLI parsing test matrix to include max. |
skills/autonomous-ai-agents/hermes-agent/SKILL.md |
Updates slash-command docs to include max. |
hermes_constants.py |
Adds max to VALID_REASONING_EFFORTS and parser docstring. |
hermes_cli/main.py |
Updates canonical reasoning effort ordering to include max. |
hermes_cli/commands.py |
Adds max to /reasoning command subcommands for help/completions. |
gateway/run.py |
Updates gateway /reasoning help + validation to accept max. |
cli.py |
Updates CLI /reasoning help + “valid levels” output to include max. |
batch_runner.py |
Extends batch-runner --reasoning_effort validation/docs to accept max. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Usage: | ||
| /reasoning Show current effort level and display state | ||
| /reasoning <level> Set reasoning effort (none, minimal, low, medium, high, xhigh) | ||
| /reasoning <level> Set reasoning effort (none, minimal, low, medium, high, xhigh, max) | ||
| /reasoning show|on Show model thinking/reasoning in output |
There was a problem hiding this comment.
/reasoning help text now lists max, but the no-args status output later in this handler still prints Usage: /reasoning <none|minimal|low|medium|high|xhigh|show|hide> (missing max). Please update that usage hint too so all CLI help surfaces are consistent.
|
|
||
| Usage: | ||
| /reasoning Show current effort level and display state | ||
| /reasoning <level> Set reasoning effort (none, minimal, low, medium, high, xhigh) | ||
| /reasoning <level> Set reasoning effort (none, minimal, low, medium, high, xhigh, max) | ||
| /reasoning show|on Show model reasoning in responses |
There was a problem hiding this comment.
The handler docstring/usage now includes max, but the no-args response still returns _Usage:_ /reasoning <none|minimal|low|medium|high|xhigh|show|hide>`` (missing max). Please update that returned usage string as well so gateway help output matches the accepted levels.
|
The root cause analysis looks right: the Anthropic adapter already knows how to emit A couple suggestions before merging to make this fully robust:
I’d suggest normalizing
Overall the patch is pointed in the right direction; I’d just make the accepted user-level enum distinct from the provider-specific wire enum so model switches don’t turn a Claude-only maximum into invalid requests elsewhere. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the upstream validation gap. The gateway defect is still present on current main: gateway/slash_commands.py:2732 accepts only through xhigh, while hermes_constants.py:794-819 already accepts max.
Problems
- The patch targets the pre-refactor handler in
gateway/run.py; current gateway dispatch lives ingateway/slash_commands.py:2634, so this needs a conflict-aware salvage rather than applying the old hunk. - Provider projection is still needed.
agent/transports/codex.py:155-166only clampsminimal → low, so acceptingmaxat the command/config layer can forward literalmaxto Codex/Responses. - The live CLI help now resides in
hermes_cli/cli_commands_mixin.py:2469-2537and still omitsmax.
Suggested changes
- Port the gateway fix to
gateway/slash_commands.py, update the live CLI/registry surfaces, and add a Codex wire-level regression that clamps or omits unsupportedmaxvalues.
Automated hermes-sweeper review.
| @@ -138,13 +138,13 @@ def get_subprocess_home() -> str | None: | |||
| return None | |||
There was a problem hiding this comment.
Accepting max globally also reaches non-Anthropic transports. Please add provider-boundary normalization: current Codex handling only maps minimal → low, so it otherwise forwards max as reasoning.effort (agent/transports/codex.py:155-166).
|
Thanks for this contribution @SamuelZ12 — you correctly identified a real gap at the time: the Anthropic adapter already understood This has since been implemented on main by #62650 (merged 2026-07-12), which added both Since there's nothing left for this branch to add, closing as implemented-on-main. That's a timing outcome, not a knock on the change — thanks again for the well-tested PR. |
|
Closing — fully superseded on current main. You were the first to propose Thanks for being early on this one; sorry it sat as long as it did. |
summary
maxas a validreasoning_effortacross Hermes parsing and command surfacesmaxappears anywhere users choose a reasoning level/reasoning max, and the reasoning effort picker orderroot cause
The Anthropic adapter already supported Claude 4.7
output_config.effort = max, but the shared reasoning parser and command validators still only accepted up toxhigh. That madeagent.reasoning_effort: maxsilently parse as invalid, so Hermes skipped sending adaptive reasoning fields even though downstream Anthropic code could handle them.testing
/Users/samuelzhang/.hermes/hermes-agent/venv/bin/python -m pytest tests/cli/test_reasoning_command.py tests/gateway/test_reasoning_command.py tests/agent/test_anthropic_adapter.py tests/hermes_cli/test_reasoning_effort_menu.py -q -o 'addopts='notes
thinking: {"type": "adaptive", "display": "summarized"}andoutput_config: {"effort": "max"}forclaude-opus-4-7