feat(cli): add --base-url flag to hermes auth add + compact auth list display - #66971
feat(cli): add --base-url flag to hermes auth add + compact auth list display#66971DeamonDev888 wants to merge 3 commits into
Conversation
Related to #54524 and #62467: both cover the base-url credential direction, but #54524 also changes per-credential runtime pooling. This PR is a narrower CLI/display alternative; its tests do not exercise the agent/runtime resolver, so maintainers should choose the intended scope. |
… entry Addresses alt-glitch feedback: tests now exercise the full auth_add_command handler with a FakePool to verify that: 1. --base-url value is stored on PooledCredential.base_url 2. Without --base-url, _provider_base_url() default is used This proves the CLI flag actually reaches the credential pool storage.
|
Addressed. Commit
Regarding scope vs #54524: this PR is intentionally narrow (CLI display + storage only). It does not change the runtime resolver or pooling logic — that broader scope lives in #62467. The tests here prove the CLI layer works correctly; the runtime layer is separately tested in #62467. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused CLI contribution. The core API-key path addresses a current-main gap: hermes_cli/auth_commands.py:218 still stores _provider_base_url(provider), while hermes_cli/runtime_provider.py:415 already resolves a selected credential's explicit endpoint and preserves a non-default entry URL at :487-491.
Problems
- The new shared parser option is only consumed by the API-key branch in the proposed
auth_add_commandhunk. Existing OAuth branches construct entries from OAuth-derived/provider URLs (hermes_cli/auth_commands.py:224-432on current main), sohermes auth add <oauth-provider> --type oauth --base-url ...would be accepted and silently ignored.
Suggested changes
- Make the flag API-key-specific and reject it for OAuth additions, or wire it through only the OAuth flows for which an override is valid; add a regression test for that contract.
- Keep CLI auth integration tests with the existing suite at
tests/hermes_cli/test_auth_commands.py.
Automated hermes-sweeper review.
| auth_add.add_argument( | ||
| "--api-key", help="API key value (otherwise prompted securely)" | ||
| ) | ||
| auth_add.add_argument( |
There was a problem hiding this comment.
--base-url is accepted for every auth add type, but the proposed handler only reads it in the API-key branch. Please either reject it for OAuth additions or define the supported OAuth semantics and test them; silently accepting an ignored endpoint override is misleading.
Addresses teknium1 feedback: --base-url was silently ignored for OAuth additions. Now raises SystemExit early with a clear message: '--base-url is only supported for API-key credentials.' Added test_base_url_rejected_for_oauth_type as regression test. 9/9 tests pass.
|
Addressed in commit
Added Regarding the existing test suite at |
Remove the --base-url flag from hermes auth add and the handler in auth_commands.py. This CLI surface is fully covered by NousResearch#66971 with better UX (compact auth list display with endpoint tags). This PR retains only the unique scope: - config credentials: list seeding for per-credential base_url - runtime URL resolution from selected pool entry - pool identity matching for nested credentials[].base_url - 6 regression tests for all three paths + backward compat Removes the only overlap with NousResearch#66971 to simplify merge sequencing.
SummaryThree open PRs address this issue complex through complementary surfaces: #54524 implements config-seeded per-credential endpoints and the runtime/recovery identity needed for rotation, #58088 fixes Z.AI config.yaml endpoint precedence, and #66971 adds explicit CLI storage plus endpoint visibility. The diffs therefore cover the reported causes at the custom-pool runtime, Z.AI resolver, and credential-entry CLI layers respectively. Related pull requests
Suggested consolidationKeep #54524 open with a salvage path centered on its recorded-best-fix config seeding, selected-entry runtime URL, nested-URL recovery identity, and regressions; this follows the automated keep_open verdict and the contributor finding that its scope is distinct. Keep #58088 open with a salvage path for its recorded-best-fix Z.AI precedence change, with author action to add the glm-alias runtime and auxiliary-caller regressions requested by the automated keep_open review; keep #66971 open for its API-key CLI override and display work, with author action to move the integration coverage into tests/hermes_cli/test_auth_commands.py as requested by its contributor keep_open review. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I54011(["issue #54011 (open)"])
I58071(["issue #58071 (open)"])
P66971["PR #66971 (open)"]
P66971 -.->|partial| I54011
P66971 -.->|partial| I58071
class I54011 open
class I58071 open
class P66971 open
class P66971 target
click I54011 "https://github.com/NousResearch/hermes-agent/issues/54011"
click I58071 "https://github.com/NousResearch/hermes-agent/issues/58071"
click P66971 "https://github.com/NousResearch/hermes-agent/pull/66971"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 3 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 41 kB of PR diffs, 13 kB of issue/PR text, 14 kB of discussion (15 comments), 6 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
Two CLI improvements for credential management:
1.
hermes auth add --base-urlNew flag lets users specify the inference base URL when adding a credential. Previously
base_urlwas hardcoded topconfig.inference_base_url— wrong for providers with multiple endpoints (Z.AI Coding Plan, MiniMax-CN, Kimi, etc.).2.
hermes auth list— compact displayMulti-endpoint providers show short tags instead of full URLs:
Before:
After:
Rules:
coding,anthropic,zai-cn,minimax-cnfor known multi-endpoint providersTests
6 unit tests covering parser + display formatting.
Files
hermes_cli/subcommands/auth.py(+6 lines —--base-urlflag)hermes_cli/auth_commands.py(+74/-2 lines — handler +auth listdisplay)tests/agent/test_auth_cli_improvements.py(+208 lines, NEW)Related
base_urlfeature requested in Credential pool: support per-credential base_url override for multi-account same-provider rotation #54011.