Skip to content

fix(minimax): use account OAuth device endpoints - #88608

Merged
steipete merged 2 commits into
openclaw:mainfrom
MatthewSchleder:fix-minimax-oauth-account-endpoints
Jun 1, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
MatthewSchleder:fix-minimax-oauth-account-endpoints

Conversation

@MatthewSchleder

@MatthewSchleder MatthewSchleder commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • update MiniMax OAuth to call the current account device-code endpoints directly
  • keep the provider API base URLs unchanged for post-login resource/config handling
  • add a regression test for both global and CN OAuth endpoint selection

Why

MiniMax now redirects api.minimax.io/oauth/code and api.minimaxi.com/oauth/code to account.* device-code endpoints. OpenClaw's guarded fetch intentionally strips POST bodies on cross-origin redirects, so the redirected MiniMax request receives an empty form and fails with client_id is required.

Validation

  • pnpm test extensions/minimax/oauth.test.ts
  • pnpm exec oxfmt --check --threads=1 extensions/minimax/oauth.ts extensions/minimax/oauth.test.ts
  • git diff --check origin/main...HEAD

Real behavior proof

Behavior addressed: MiniMax OAuth login no longer posts the device-code form to API hosts that redirect cross-origin and lose the POST body under OpenClaw's guarded fetch.

Real environment tested: OpenClaw MiniMax OAuth setup against live MiniMax global and CN OAuth endpoints.

Exact steps or command run after this patch: openclaw models auth login --provider minimax-portal --method oauth; maintainer also ran live POST probes against the old API OAuth URLs and the new account OAuth URLs for both global and CN.

Evidence after fix: The after-patch screenshot shows the MiniMax OAuth browser approval prompt. Live probes also showed old API code/token URLs redirect to account.minimax.io / account.minimaxi.com /oauth2/* endpoints, direct account device-code endpoints return valid user_code and verification_uri, and direct token endpoints return pending for fresh unapproved user codes.

Observed result after fix: OpenClaw reaches the MiniMax account authorization prompt instead of failing before authorization with client_id is required.

What was not tested: Full browser approval and persisted-token storage with a real MiniMax account was not completed.

After patch:
image

Before patch:
image
image

@openclaw-barnacle openclaw-barnacle Bot added extensions: minimax size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 31, 2026
@clawsweeper

clawsweeper Bot commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 8:39 PM ET / 00:39 UTC.

Summary
The PR updates MiniMax OAuth device-code and token requests to use account.minimax.io / account.minimaxi.com /oauth2/* endpoints while preserving API base URLs for resource access, and adds global/CN regression coverage.

PR surface: Source +2, Tests +61. Total +63 across 2 files.

Reproducibility: yes. from source and live-provider evidence: current main posts MiniMax OAuth forms to API hosts, guarded fetch strips POST bodies on cross-origin redirects, and maintainer probes confirmed those API OAuth URLs now redirect to account /oauth2/* endpoints. I did not personally complete the failing login end-to-end, so this is source-reproducible rather than locally reproduced.

Review metrics: 1 noteworthy metric.

  • MiniMax OAuth endpoint routing: 2 regions changed code/token hosts; 0 provider API base URLs changed. This separates login endpoint routing from runtime resource API routing, which is the compatibility-sensitive point maintainers should review before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Merging changes the OAuth host used for MiniMax global/CN device-code and token polling, so existing MiniMax auth behavior depends on the account endpoints remaining the correct provider contract.
  • [P1] Full browser approval and persisted-token storage with a real MiniMax account were not completed; current proof covers endpoint selection, user-code issuance, and pending token polling.

Maintainer options:

  1. Accept Endpoint Contract Proof (recommended)
    Maintainers can accept the live endpoint probes plus MiniMax CLI source as sufficient for switching MiniMax OAuth to account hosts while noting the untested approval-through-persistence path.
  2. Request Full Login Proof
    If maintainers want to retire the remaining auth risk before merge, ask for redacted proof that a real MiniMax approval completes and persists a usable token.
  3. Pause For Provider Confirmation
    If the account endpoint contract is still disputed, pause the PR until MiniMax documentation or owner confirmation explicitly names the OAuth device-code and token hosts.

Next step before merge

  • [P2] The remaining action is maintainer acceptance of an auth-provider endpoint contract and optional full-login proof, not an automated repair.

Security
Cleared: The diff changes MiniMax OAuth endpoint constants and regression tests only; I found no new dependency, CI, script, permission, secret-handling, or broader supply-chain concern.

Review details

Best possible solution:

Land this scoped endpoint update once maintainers accept the auth-provider contract evidence, with full approval-through-token persistence proof as an optional risk reducer rather than a code blocker.

Do we have a high-confidence way to reproduce the issue?

Yes from source and live-provider evidence: current main posts MiniMax OAuth forms to API hosts, guarded fetch strips POST bodies on cross-origin redirects, and maintainer probes confirmed those API OAuth URLs now redirect to account /oauth2/* endpoints. I did not personally complete the failing login end-to-end, so this is source-reproducible rather than locally reproduced.

Is this the best way to solve the issue?

Yes: changing only the MiniMax OAuth code/token endpoints to the provider's account OAuth hosts while leaving post-login API base URLs unchanged is the narrowest maintainable fix shown by current code, tests, live probes, and MiniMax CLI source.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against b3742b9edbd7.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes before/after screenshots and a maintainer comment adds live MiniMax endpoint probes showing direct account device-code issuance and pending token polling for both regions; full approval and persistence remain a known gap but not absence of real endpoint proof.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: This is a normal-priority provider auth fix with limited surface area and focused regression coverage, not a core outage or emergency.
  • merge-risk: 🚨 auth-provider: The PR changes MiniMax OAuth code/token hosts and the guarded-fetch allowlisted OAuth hostname, which affects provider login and token polling behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes before/after screenshots and a maintainer comment adds live MiniMax endpoint probes showing direct account device-code issuance and pending token polling for both regions; full approval and persistence remain a known gap but not absence of real endpoint proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes before/after screenshots and a maintainer comment adds live MiniMax endpoint probes showing direct account device-code issuance and pending token polling for both regions; full approval and persistence remain a known gap but not absence of real endpoint proof.
Evidence reviewed

PR surface:

Source +2, Tests +61. Total +63 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 3 +2
Tests 1 61 0 +61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 66 3 +63

What I checked:

  • Root policy read: Read the full root AGENTS.md and applied the OpenClaw PR review rules for auth-provider compatibility risk, real behavior proof, release-owned changelog handling, and dependency-contract checks. (AGENTS.md:1, b3742b9edbd7)
  • Scoped extension policy read: Read the full extensions guide and confirmed this MiniMax auth work stays inside the bundled plugin boundary without introducing core imports or new SDK surface. (extensions/AGENTS.md:1, b3742b9edbd7)
  • Current main behavior: Current main still builds MiniMax OAuth code/token endpoints from the API base URL (/oauth/code and /oauth/token) and uses that same API hostname for the guarded fetch allowlist. (extensions/minimax/oauth.ts:14, b3742b9edbd7)
  • Patch behavior: The PR head adds separate account OAuth base URLs, sends code/token calls to /oauth2/device/code and /oauth2/token, and keeps baseUrl pointed at the existing API host for post-login provider config. (extensions/minimax/oauth.ts:14, 18eab052f808)
  • Regression coverage: The added test covers both global and cn MiniMax OAuth login paths, records the two fetch URLs, and asserts the direct account code/token endpoints. (extensions/minimax/oauth.test.ts:32, 18eab052f808)
  • Guarded redirect behavior: The guarded fetch path rewrites unsafe cross-origin redirects by clearing request bodies and body headers unless unsafe replay is explicitly allowed, which matches the reported MiniMax client_id is required redirect failure mode. (src/infra/net/fetch-guard.ts:378, b3742b9edbd7)

Likely related people:

  • steipete: Peter Steinberger authored the MiniMax bundled-plugin merge in history, committed nearby release-history touches, and posted the current PR's maintainer proof with live endpoint checks. (role: feature-history owner and recent reviewer; confidence: high; commits: 47a9c1a89342, e93216080aa1, 18eab052f808; files: extensions/minimax/oauth.ts, extensions/minimax/provider-registration.ts, extensions/minimax/oauth.test.ts)
  • Vincent Koc: Current blame/log for the MiniMax OAuth and provider-registration files points to recent broad MiniMax area import/maintenance by Vincent Koc. (role: recent area contributor; confidence: medium; commits: ae4550f48ba0, 91d37ccfc309; files: extensions/minimax/oauth.ts, extensions/minimax/provider-registration.ts, extensions/minimax/oauth.test.ts)
  • RyanLee: RyanLee previously fixed the MiniMax portal OAuth config patch path that consumes the token/base URL returned by this OAuth flow. (role: adjacent auth contributor; confidence: medium; commits: 415578c4dc0a; files: extensions/minimax/provider-registration.ts, extensions/minimax/index.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 31, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 31, 2026
@steipete steipete self-assigned this May 31, 2026
@steipete
steipete force-pushed the fix-minimax-oauth-account-endpoints branch from cdb0841 to 18eab05 Compare June 1, 2026 00:30
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 1, 2026
@steipete

steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Maintainer proof for landing on SHA 18eab05.

Summary:

  • Rebased the PR onto current main.
  • Removed the CHANGELOG.md edit per release-owned changelog policy.
  • Kept the change scoped to extensions/minimax/oauth.ts and extensions/minimax/oauth.test.ts.

Local commands run:

  • pnpm test extensions/minimax/oauth.test.ts
  • pnpm exec oxfmt --check --threads=1 extensions/minimax/oauth.ts extensions/minimax/oauth.test.ts
  • git diff --check origin/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --prompt-file /tmp/pr88608-autoreview-evidence.md

Results:

  • MiniMax OAuth test shard passed: 1 file, 9 tests.
  • Targeted oxfmt passed.
  • Diff whitespace check passed.
  • First autoreview raised an endpoint-contract concern; I verified it against live MiniMax behavior and official MiniMax CLI source, then reran autoreview with that evidence.
  • Final autoreview was clean: no accepted/actionable findings reported.

Live MiniMax proof checked before landing:

Official MiniMax source checked:

  • MiniMax-AI/cli src/config/schema.ts defines global/cn OAuth hosts as account.minimax.io/account.minimaxi.com.
  • MiniMax-AI/cli src/auth/oauth.ts uses /oauth2/device/code and /oauth2/token.

Known proof gap:

  • I did not complete browser approval and persisted-token storage with a real MiniMax account. Endpoint selection and polling behavior are live-proven.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@steipete

steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Updated maintainer proof for SHA 6bfe20e.

Additional maintainer fixup:

  • Added a second test-only commit to avoid Request default stringification in the new endpoint assertion.

Local commands run after the fixup:

  • pnpm test extensions/minimax/oauth.test.ts
  • pnpm exec oxfmt --check --threads=1 extensions/minimax/oauth.ts extensions/minimax/oauth.test.ts
  • pnpm lint --threads=8
  • git diff --check origin/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --prompt-file /tmp/pr88608-autoreview-evidence.md

Results:

  • MiniMax OAuth test shard passed: 1 file, 9 tests.
  • Targeted oxfmt passed.
  • Full local lint passed.
  • Diff whitespace check passed.
  • Final autoreview clean: no accepted/actionable findings reported.

@steipete
steipete merged commit 6a96058 into openclaw:main Jun 1, 2026
154 checks passed
@xxtyyq

xxtyyq commented Jun 1, 2026

Copy link
Copy Markdown

Also seeing this issue. Confirmed error: client_id is required during MiniMax OAuth device-code flow. This matches the described bug — API OAuth endpoints redirect to account endpoints, and guarded fetch strips POST body on redirect. Please prioritize this fix, many users are blocked on OAuth login.

@MatthewSchleder

Copy link
Copy Markdown
Contributor Author

Also seeing this issue. Confirmed error: client_id is required during MiniMax OAuth device-code flow. This matches the described bug — API OAuth endpoints redirect to account endpoints, and guarded fetch strips POST body on redirect. Please prioritize this fix, many users are blocked on OAuth login.

It has been merged and should be released in the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: minimax merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants