fix(minimax-oauth): correct authorize URL domain and handle ms timestamps#20374
Closed
NikolaFC wants to merge 1 commit into
Closed
fix(minimax-oauth): correct authorize URL domain and handle ms timestamps#20374NikolaFC wants to merge 1 commit into
NikolaFC wants to merge 1 commit into
Conversation
…amps MiniMax OAuth has two issues: 1. The /oauth/code endpoint returns verification_uri pointing to www.minimax.io/oauth-authorize, but that route 307s to the homepage. The correct domain is platform.minimax.io which serves the actual authorize page. Fix: replace www.minimax.io with platform.minimax.io in the verification URL before presenting it to the user. 2. The token endpoint returns expired_in as a unix-ms timestamp (e.g. 1778010274711) rather than a duration in seconds. The code added this directly to datetime.timestamp(), causing 'year 58374 is out of range'. Fix: detect ms timestamps (value > now_ms // 2) and convert to seconds-from-now before use. Applied in both _minimax_oauth_login and _refresh_minimax_oauth_state. Tested: OAuth login succeeds, token stored with correct expires_at, m27 model responds via Token Plan.
This was referenced May 8, 2026
Contributor
|
Closing as superseded by #24165. Triage notes (high confidence): Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen. (Bulk-closed during a CLI PR triage sweep.) |
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.
Fixes #19337
What
Fixes two bugs in the MiniMax OAuth login flow that prevent
hermes model→ MiniMax (OAuth) from completing.Bug 1: Authorize URL redirects to homepage
The
/oauth/codeendpoint returnsverification_uripointing towww.minimax.io/oauth-authorize, but that route returns a307redirect to/(the homepage). The correct domain isplatform.minimax.io, which serves the actual authorize page with the user code input.Reproduction:
Fix: Replace
www.minimax.io→platform.minimax.ioin the verification URL before presenting it to the user.Bug 2:
expired_inparsed as seconds but is unix-ms timestampThe token endpoint returns
expired_inas a unix-ms timestamp (e.g.1778010274711), not a duration in seconds. The code added this directly todatetime.timestamp()(seconds), causing:Fix: Detect ms timestamps (value >
now_ms // 2) and convert to seconds-from-now. Applied in both_minimax_oauth_loginand_refresh_minimax_oauth_state.Testing
expires_at(~48h from now)hermes chat -q "Say OK" -m m27responds via Token PlanRelated