fix(cli): deprecated hermes login fails gracefully for any provider - #47706
Merged
Conversation
`hermes login` was removed in favor of `hermes auth` / `hermes model`, but the subparser still validated `--provider` against a hardcoded choices list (nous, openai-codex, xai-oauth). Running `hermes login --provider anthropic` therefore crashed in argparse with `invalid choice: 'anthropic'` *before* the deprecation handler could print the redirect to `hermes model` — so a user trying to authenticate a perfectly valid provider just saw a hard error and assumed the feature was broken rather than relocated. - Drop the restrictive `choices=` so every `--provider` value reaches the deprecation handler (which ignores the value and prints guidance). - Omit the subparser `help=` kwarg so the dead command no longer advertises itself in `hermes --help` (#24756). Avoids the `==SUPPRESS==` placeholder leak that `help=argparse.SUPPRESS` emits for a top-level subparser on 3.12+. - `hermes login [--flags]` still reaches the actionable deprecation message for old scripts/aliases; `hermes login --help` shows the redirect. Picks up the intent of the inactivity-closed #24902, rebased onto the post-refactor parser location (hermes_cli/subcommands/login.py) and extended to fix the whole bug class (any provider value), not just hiding from --help. Tests: parametrized provider acceptance + help-suppression (no SUPPRESS leak).
kshitijk4poor
enabled auto-merge
June 17, 2026 07:26
Contributor
🔎 Lint report:
|
kshitijk4poor
disabled auto-merge
June 17, 2026 07:27
Collaborator
|
Related: #24756 (underlying bug), #24902 (closed-for-inactivity prior attempt that hid the --help row — this PR rebases onto the post-refactor parser location and extends the fix to drop the restrictive choices= so any provider value reaches the deprecation handler), and #2806 (open, docs-only mechanism vs. this PR's runtime UX fix). Not a duplicate — broader scope than the closed #24902 and different mechanism from #2806. |
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…-deprecation-graceful fix(cli): deprecated `hermes login` fails gracefully for any provider
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…-deprecation-graceful fix(cli): deprecated `hermes login` fails gracefully for any provider
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…-deprecation-graceful fix(cli): deprecated `hermes login` fails gracefully for any provider
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…-deprecation-graceful fix(cli): deprecated `hermes login` fails gracefully for any provider
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…-deprecation-graceful fix(cli): deprecated `hermes login` fails gracefully for any provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
`hermes login` was deprecated in favor of `hermes auth` / `hermes model` — its handler (`login_command` in `hermes_cli/auth.py`) just prints a redirect and exits. But the subparser still validates `--provider` against a hardcoded list:
```python
choices=["nous", "openai-codex", "xai-oauth"]
```
So a user trying a valid-but-unlisted provider hits a hard argparse crash before the friendly deprecation message can run:
```
$ hermes login --provider anthropic
hermes login: error: argument --provider: invalid choice: 'anthropic'
(choose from 'nous', 'openai-codex', 'xai-oauth')
```
This is exactly the trap for someone trying to wire up Claude Pro/Max subscription auth (fully supported via `hermes model` → Anthropic → OAuth). They follow `hermes login`, get `invalid choice`, and assume the feature is broken rather than relocated. `hermes login --provider nous` at least prints the deprecation message — `anthropic` doesn't even get that far.
The fix
Relationship to prior art
Picks up the intent of #24902 (inactivity-closed, not rejected — author said "the underlying fix still stands"), rebased onto the post-refactor parser location (`hermes_cli/subcommands/login.py`, moved by the subcommand-extraction refactor #568e12761) and extended to fix the whole bug class — any provider value, not just hiding the `--help` row. #2806 (open) migrates docs strings only; this fixes the runtime UX.
Verification (real CLI, not just unit mocks)
```
$ hermes login --provider anthropic
The 'hermes login' command has been removed.
Use 'hermes auth' to manage credentials,
'hermes model' to select a provider, or 'hermes setup' for full setup. # exit 0
$ hermes --help # no 'login' row, no ==SUPPRESS== leak
$ hermes login --help # shows the deprecation redirect (old scripts)
```
Tests
`tests/hermes_cli/test_subcommands_batch.py`:
67 passed (batch + startup-plugin-gating). Behavior-contract tests, not snapshots.