fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp#83480
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-20 10:10 UTC / May 20, 2026, 6:10 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. by source inspection: current main stores MiniMax PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow provider-local expiry normalization if maintainers accept the OAuth-only scope, and make any broader MiniMax OAuth2 or refresh branch reuse the same expiry contract. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main stores MiniMax Is this the best way to solve the issue? Yes, normalizing MiniMax token expiry at the provider boundary is the narrowest maintainable fix for this OAuth path. Any recovery for already-bad stored profiles should be handled as separate refresh or re-login proof, not by broadening core auth semantics. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 167e73cd5f84. |
33702de to
8ca77fd
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Mossy Patch Peep Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
|
@clawsweeper hatch |
|
🦞👀 I queued a comment sync for this PR. If the egg is hatchable, ClawSweeper will generate the image once and update the existing review comment. |
…mestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]>
445a94e to
026b625
Compare
|
Thanks @NianJiuZst, landed with a small maintainer follow-up on top. Proof:
Merged as d4e42d6. |
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…mestamp (openclaw#83480) * fix(minimax): normalize OAuth token expiry to absolute millisecond timestamp MiniMax returns expired_in from the token endpoint as a relative duration in seconds (standard OAuth expires_in semantics), but the auth profile store's hasUsableOAuthCredential() expects an absolute millisecond timestamp. Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to api.minimaxi.com on every request — the root cause of the 30-50s auth-stage delay. Fixes openclaw#83449. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(minimax): cover oauth expiry normalization * fix: polish minimax oauth expiry normalization (openclaw#83480) (thanks @NianJiuZst) * fix: update minimax raw fetch allowlist (openclaw#83480) --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Summary
Converts MiniMax OAuth token
expired_infrom relative seconds to an absolute millisecond timestamp, fixinghasUsableOAuthCredential()always treating the token as expired.This PR narrows the fix to the MiniMax Portal OAuth expiry path. It does not claim to fix the separate MiniMax API-key path discussed on #83449.
Real behavior proof
Behavior addressed: MiniMax Portal OAuth credentials in OpenClaw should stop looking immediately expired, so requests no longer spend 30-50s repeatedly stuck in auth before reaching the MiniMax provider.
Real environment tested: Local OpenClaw CLI from this branch on macOS, using the existing
minimax-portalOAuth profile from~/.openclaw/agents/main/agent/auth-profiles.json.Exact steps or command run after this patch:
pnpm openclaw models statusTIMEFMT='real %E'; time pnpm openclaw infer model run --local --model minimax-portal/MiniMax-M2.7 --prompt 'Reply with OK only.' --jsonEvidence after fix:
Terminal capture after this patch:
Observed result after fix: The stored MiniMax Portal OAuth credential was recognized as valid (
ok expires in 364d), and two consecutive real localminimax-portalrequests reached the provider and returned the same provider-side 400 in about 6 seconds instead of reproducing the original 30-50s auth-stage stall.What was not tested: Successful MiniMax text generation beyond this provider-side 400 response, the separate MiniMax API-key path, and the installed 2026.5.12 gateway binary outside this local branch run.
Root Cause
MiniMax returns
expired_infrom the token endpoint as a relative duration in seconds (standard OAuthexpires_insemantics), but the auth profile store'shasUsableOAuthCredential()expects an absolute millisecond timestamp:Without conversion the token appears perpetually expired, triggering a slow OAuth refresh network call to
api.minimaxi.comon every request. Combined with CN network latency this causes the reported 30-50s auth-stage delay.Changes
extensions/minimax/oauth.ts: AddednormalizeOAuthExpires()that handles three possibleexpired_informats:Date.now() + expiredIn * 1000expiredIn * 1000extensions/minimax/oauth.test.ts: Added focused regression coverage for relative seconds, Unix seconds, and millisecond timestamps.Verification
Related #83449.
🤖 Generated with Claude Code