Skip to content

fix(cli): hermes-agent --help/--version print help instead of running a model turn (#54648, salvage #54649) - #120440

Merged
teknium1 merged 2 commits into
mainfrom
fix/hermes-agent-help-no-turn
Sep 23, 2026
Merged

teknium1 merged 2 commits into
mainfrom
fix/hermes-agent-help-no-turn

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

hermes-agent --help, -h, --version and a bare hermes-agent now print help/version and exit instead of running a real model turn, and hermes-agent --query … actually runs the query you passed (#54648, salvage of #54649).

Changes

  • hermes-agent console script → agent.legacy_cli:main, an argparse layer over the unchanged run_agent.main() (salvaged from @ooiuuii's fix(cli): guard legacy hermes-agent entrypoint #54649, authorship kept).
  • python run_agent.py routes through the same parser instead of fire. That is also what the installer's PATH launcher ~/.local/bin/hermes-agent runs, so the launcher is fixed too.
  • The argument layer sits in a topical sibling (agent/legacy_cli.py) and does not grow the run_agent.py facade. The runner is injected (run=), so python run_agent.py does not import itself twice.
  • Docs: added a hermes-agent section to the CLI commands reference.

Validation

Live repro: before: on origin/main, the real pip-style hermes-agent wrapper plus the installer launcher were run against a loopback fake provider. --help, -h, --version and no args each made 1 model call with the hard-coded "Python 3.13" demo query. --query "say hi" also sent the demo query. The launcher's --version ran a turn and then exited 2. After: the same probe gives 0 model calls for every metadata/bare case, all rc=0, and they print usage: hermes-agent … / Hermes Agent v0.21.4 (2026.9.21). --query "say hi" makes 1 call carrying say hi.

invocation origin/main this PR
hermes-agent --help / -h 1 model call (demo query) help, 0 calls
hermes-agent --version 1 model call version, 0 calls
hermes-agent (no args) 1 model call help + hint, 0 calls
launcher --version 1 model call, rc=2 version, 0 calls
hermes-agent --query "say hi" sends the demo query sends say hi

Tests: 2 invariants in tests/agent/test_legacy_cli.py. Each resolves the hermes-agent target from pyproject [project.scripts] and calls it the way pip's wrapper does (no args, argv in sys.argv). On origin/main all 5 cases (4 parametrized + 1) fail. With the fix they pass. tests/agent/ + tests/scripts/install/ were run via scripts/run_tests.sh. ruff, the tmp-literal check, the windows-footgun check, compat pointers and git diff --check are all clean.

Root cause: a console script calls its target with no arguments, and hermes-agent pointed straight at run_agent.main, whose query=None default is a built-in demo prompt. fire only parsed argv under __main__, so no flag was ever read.

Notes

Fixes #54648

Infographic

hermes-agent help means help

ooiuuii and others added 2 commits September 23, 2026 08:46
Follow-up to the salvaged wrapper: the argument layer now lives in a topical
sibling (agent/legacy_cli.py) instead of growing the run_agent facade, and
`python run_agent.py` (the installer's PATH launcher for hermes-agent) routes
through the same parser instead of fire, so `--version` and a bare invocation
no longer run the demo turn there either.

- --help/-h/--version use argparse's own exit path; options carry help text
- the runner is injected (`run=`) so `python run_agent.py` does not import
  run_agent a second time
- tests trimmed to two invariants that resolve the console-script target
  from pyproject exactly like pip's wrapper (red on main, green here)
- docs: hermes-agent section in the CLI reference
@teknium1
teknium1 requested a review from a team September 23, 2026 16:11
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 11fdefd — fix(cli): move the hermes-agent argv layer into agent/legacy

⚠️ Warnings

CI timings · View report · View job

Wall time 8m40s vs 6m10s (+40.5%). 11 job(s) slower, 2 faster, 1 unchanged.

  • Python lints / Windows footguns (blocking): +100.0s
  • Python tests / Run tests: +81.0s
  • Docs Site / docs-site-checks: +50.0s
  • Check uv.lock / uv lock --check: +30.0s
  • Check no committed infographics / check-no-committed-infographics: +27.0s

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard area/install-update Installer, updater, packaging, wheels, doctor labels Sep 23, 2026
@teknium1 teknium1 added the ci-reviewed applied to manually approve dangerous changes label Sep 23, 2026
@teknium1
teknium1 merged commit 2fb564d into main Sep 23, 2026
40 checks passed
@teknium1
teknium1 deleted the fix/hermes-agent-help-no-turn branch September 23, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install-update Installer, updater, packaging, wheels, doctor ci-reviewed applied to manually approve dangerous changes comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes-agent --version starts an agent run instead of printing version

3 participants