Skip to content

fix(cli): rewrite stale MiniMax OAuth verification_uri and surface setup failures#19466

Closed
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:fix/minimax-oauth-setup-resilience
Closed

fix(cli): rewrite stale MiniMax OAuth verification_uri and surface setup failures#19466
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:fix/minimax-oauth-setup-resilience

Conversation

@konsisumer

Copy link
Copy Markdown
Contributor

Fixes the silent failure of hermes setup quick-wizard for MiniMax OAuth and the stale verification_uri that returns from MiniMax's /oauth/code.

What changed and why

  • hermes_cli/auth.py: Added _normalize_minimax_verification_uri() and apply it inside _minimax_request_user_code(). MiniMax currently returns https://www.minimax.io/oauth-authorize?... which 307-redirects to the marketing homepage and has no OAuth approval UI — the live approval page is at platform.minimax.io/oauth-authorize?.... Rewrite the host client-side until upstream is fixed. Bare paths and unrelated hosts are left untouched.
  • hermes_cli/main.py: Replaced the catch-all except SystemExit: print("Login cancelled or failed.") in _model_flow_minimax_oauth() with explicit KeyboardInterrupt / SystemExit / Exception branches. Each branch flushes stdout, logs a traceback at warning level for the generic case, and tells the user the provider was not configured and how to retry. This stops the wizard from appearing to silently advance after an OAuth error.
  • tests/test_minimax_oauth.py: Added 5 tests — _normalize_minimax_verification_uri happy/unrelated/end-to-end, plus three _model_flow_minimax_oauth tests covering the SystemExit, generic-Exception, and KeyboardInterrupt paths.

How to test

  • pytest tests/test_minimax_oauth.py -q (21 passed).
  • Manual: simulate a failing OAuth login (e.g. block api.minimax.io in /etc/hosts) and run hermes setup → "MiniMax via OAuth browser login". The wizard now prints MiniMax OAuth login failed: ... Provider not configured. Re-run 'hermes model' to retry. instead of advancing silently.
  • Verify the printed verification URL points at platform.minimax.io rather than www.minimax.io.

What platforms tested on

  • macOS on darwin-arm64 (local) — full pytest tests/hermes_cli tests/test_minimax_oauth.py run: 1359 passed, 1 skipped, 1 pre-existing systemd test failure unrelated to this change.

Fixes #19336
Fixes #19337

@konsisumer konsisumer force-pushed the fix/minimax-oauth-setup-resilience branch from 4e763ad to be06128 Compare June 1, 2026 19:34
@konsisumer

Copy link
Copy Markdown
Contributor Author

Rebased onto current origin/main to clear the merge conflict (PR was DIRTY). The only conflict was in tests/test_minimax_oauth.py — both upstream's newly added build_minimax_oauth_token_provider / generic-auth-dispatch tests and this PR's verification-uri normalization + setup-failure-surfacing tests were additive at the same location, so both sets were kept (no test lost, no duplicate names). Re-ran the in-scope suite: pytest tests/test_minimax_oauth.py -> 34 passed; ruff check clean. The previously-red test check's failures are all in files outside this PR's scope (gateway/teams/update/dockerfile/kanban tests) and appear to be pre-existing upstream issues unrelated to this change.

@konsisumer

Copy link
Copy Markdown
Contributor Author

Closing — deferring to #19461 by @LeonSGP43 which addresses the same. Reopen if that PR stalls.

@konsisumer konsisumer closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/minimax MiniMax (Anthropic transport) type/bug Something isn't working

Projects

None yet

2 participants