Skip to content

fix(minimax): harden OAuth dashboard and runtime#24123

Closed
austinpickett wants to merge 8 commits into
mainfrom
austin/fix/minimax-oauth
Closed

fix(minimax): harden OAuth dashboard and runtime#24123
austinpickett wants to merge 8 commits into
mainfrom
austin/fix/minimax-oauth

Conversation

@austinpickett

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes several MiniMax OAuth regressions found during dashboard login and runtime testing:

  • Handles MiniMax expired_in values when they arrive as either TTL seconds or unix-ms absolute timestamps, preventing year 58391 is out of range in CLI and dashboard OAuth flows.
  • Makes hermes auth status minimax-oauth report the actual MiniMax OAuth auth store state.
  • Makes hermes auth add minimax-oauth start the MiniMax OAuth login flow instead of requiring credentials to already exist.
  • Forces pooled minimax-oauth runtime credentials through anthropic_messages so stale model.api_mode: chat_completions config cannot send requests to the wrong /anthropic/chat/completions path and trigger MiniMax nginx 404s.
  • Adds a web/package.json Node engine requirement matching Vite 7 so old Node versions warn before dashboard builds fail at crypto.hash.

Related Issue

No single issue. Related open PRs found while checking for duplicates: #22020, #22240, #22830, #23639.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • hermes_cli/auth.py: centralize MiniMax expiry parsing, apply it to login/refresh, and route generic auth status to MiniMax OAuth status.
  • hermes_cli/web_server.py: use the same MiniMax expiry parser when the dashboard poller saves OAuth state.
  • hermes_cli/auth_commands.py: make auth add minimax-oauth initiate login and persist a usable OAuth pool entry.
  • hermes_cli/runtime_provider.py: force pooled minimax-oauth credentials to use Anthropic Messages transport.
  • tests/: add regression coverage for MiniMax expiry parsing, dashboard OAuth completion, auth command behavior, status dispatch, and stale API mode handling.
  • web/package.json: declare the Node version required by Vite 7.

How to Test

  1. Run focused regression tests:
    .venv/bin/pytest tests/hermes_cli/test_runtime_provider_resolution.py tests/test_minimax_oauth.py tests/hermes_cli/test_auth_commands.py -q --tb=short
  2. Run dashboard OAuth dispatch coverage:
    .venv/bin/pytest tests/hermes_cli/test_web_oauth_dispatch.py tests/test_minimax_oauth.py -q --tb=short
  3. Manual smoke test on macOS: connect MiniMax OAuth in hermes dashboard, verify hermes auth status minimax-oauth, then send hi using minimax-oauth / MiniMax-M2.7.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15 / Darwin 24.5.0

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

N/A

Screenshots / Logs

Focused tests passed locally:

175 passed in 2.81s
69 passed in 2.75s

Manual dashboard flow succeeded after the fixes: MiniMax OAuth connected, hermes auth status minimax-oauth reported logged in, and a simple hi prompt completed against MiniMax-M2.7.

Made with Cursor

Handle MiniMax OAuth expiry values consistently across CLI and dashboard flows, fix CLI status/add behavior, and force pooled OAuth runtime requests through Anthropic Messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: austin/fix/minimax-oauth vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8175 on HEAD, 8175 on base (➖ 0)

🆕 New issues (2):

Rule Count
invalid-argument-type 2
First entries
hermes_cli/auth.py:4056: [invalid-argument-type] invalid-argument-type: Argument to function `get_api_key_provider_status` is incorrect: Expected `str`, found `(str & ~Literal["spotify"] & ~Literal["nous"] & ~Literal["openai-codex"] & ~Literal["qwen-oauth"] & ~Literal["google-gemini-cli"] & ~Literal["minimax-oauth"] & ~Literal["copilot-acp"]) | None`
hermes_cli/auth.py:4054: [invalid-argument-type] invalid-argument-type: Argument to bound method `dict.get` is incorrect: Expected `str`, found `(str & ~Literal["spotify"] & ~Literal["nous"] & ~Literal["openai-codex"] & ~Literal["qwen-oauth"] & ~Literal["google-gemini-cli"] & ~Literal["minimax-oauth"] & ~Literal["copilot-acp"]) | None`

✅ Fixed issues (2):

Rule Count
invalid-argument-type 2
First entries
hermes_cli/auth.py:4052: [invalid-argument-type] invalid-argument-type: Argument to bound method `dict.get` is incorrect: Expected `str`, found `(str & ~Literal["spotify"] & ~Literal["nous"] & ~Literal["openai-codex"] & ~Literal["qwen-oauth"] & ~Literal["google-gemini-cli"] & ~Literal["copilot-acp"]) | None`
hermes_cli/auth.py:4054: [invalid-argument-type] invalid-argument-type: Argument to function `get_api_key_provider_status` is incorrect: Expected `str`, found `(str & ~Literal["spotify"] & ~Literal["nous"] & ~Literal["openai-codex"] & ~Literal["qwen-oauth"] & ~Literal["google-gemini-cli"] & ~Literal["copilot-acp"]) | None`

Unchanged: 4305 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard provider/minimax MiniMax (Anthropic transport) area/auth Authentication, OAuth, credential pools P3 Low — cosmetic, nice to have labels May 12, 2026
@austinpickett austinpickett requested a review from Copilot May 12, 2026 02:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the MiniMax OAuth integration across CLI, dashboard (web_server), and runtime provider resolution by normalizing MiniMax token expiry formats and preventing stale configuration from routing MiniMax OAuth traffic to the wrong API path.

Changes:

  • Centralizes MiniMax expired_in parsing to correctly handle both TTL-seconds and unix-ms absolute expiry values, and reuses it in login/refresh and the dashboard poller.
  • Updates hermes auth behaviors for MiniMax OAuth: auth status dispatches to MiniMax OAuth status, and auth add minimax-oauth now initiates the login flow and persists a usable pool entry.
  • Forces pooled minimax-oauth runtime credentials to use anthropic_messages transport to avoid stale chat_completions config causing /anthropic/chat/completions 404s; adds regression tests for all touched flows.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web/package.json Adds a Node engine constraint to warn early on unsupported Node versions for the Vite 7-based dashboard build.
hermes_cli/auth.py Adds centralized MiniMax expiry normalization and routes generic auth status to MiniMax OAuth status.
hermes_cli/web_server.py Uses the shared MiniMax expiry resolver in the dashboard poller to avoid out-of-range timestamps.
hermes_cli/auth_commands.py Makes auth add minimax-oauth start the OAuth flow and persist an OAuth pool entry (access + refresh + base URL).
hermes_cli/runtime_provider.py Forces pooled MiniMax OAuth runtime to anthropic_messages regardless of stale config api_mode.
tests/test_minimax_oauth.py Adds unit coverage for expiry normalization, refresh absolute-ms handling, and generic auth status dispatch.
tests/hermes_cli/test_web_oauth_dispatch.py Adds regression coverage for dashboard poller handling absolute-ms expired_in.
tests/hermes_cli/test_runtime_provider_resolution.py Adds regression coverage ensuring pool-based MiniMax OAuth resolution forces anthropic_messages.
tests/hermes_cli/test_auth_commands.py Adds regression coverage ensuring auth add minimax-oauth initiates login and persists a pool entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

austinpickett and others added 4 commits May 11, 2026 23:21
Avoid the quarantined mistralai package in broad extras and mark an already POSIX-gated process-group kill for the Windows footgun scanner.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the platform command e2e suite focused on the /new reset path by disabling destructive slash confirmation in its mocked runner fixture.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update stale gateway and auxiliary-client tests for current defaults, harden media delivery and API kwargs helpers for partial fixtures, and keep process-scan tests on the intended ps fallback path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep plugin auth assertions focused on middleware behavior and patch vision fast-path config readers directly in the native-vision test.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep auth status output from echoing provider-sourced values so CodeQL does not flag token-derived metadata as clear-text sensitive logging.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread hermes_cli/auth_commands.py Fixed
austinpickett and others added 2 commits May 12, 2026 00:35
Prevent CodeQL from treating the CLI provider argument as sensitive data in auth status output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #24165 — cherry-picked your MiniMax OAuth commit (4817327) onto current main with your authorship preserved via rebase-merge. Dropped the mistralai-extra / Node-engines / process_registry-comment hunks since those were unrelated to the MiniMax fix; please resubmit the mistralai PyPI-quarantine fix as its own PR if you want it in. Thanks for the thorough fix and tests!

@teknium1 teknium1 closed this May 12, 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

Development

Successfully merging this pull request may close these issues.

5 participants