Skip to content

fix: scope OAuth resource URL to OAuth credentials - #284

Open
ch-z-hc wants to merge 1 commit into
MiniMax-AI:mainfrom
ch-z-hc:fix/oauth-resource-key-host
Open

ch-z-hc wants to merge 1 commit into
MiniMax-AI:mainfrom
ch-z-hc:fix/oauth-resource-key-host

Conversation

@ch-z-hc

@ch-z-hc ch-z-hc commented Oct 13, 2026 •

Copy link
Copy Markdown

Bug

With OAuth credentials saved in config.json, --api-key correctly selects the supplied key, but loadConfig() still takes the base URL from oauth.resource_url. An explicit --region global or --region cn therefore does not select that region's API host unless the user also supplies a base URL.

Fix

Only use the saved OAuth resource URL when there is no explicit API key. Keep explicit base URL precedence and OAuth's priority over a stored API key unchanged.

Four regression/control cases cover both regions, OAuth with a coexisting stored key, and an explicit base URL. Both regional regressions fail against the unchanged loader and pass with the patch.

Validation

  • Bun 1.4.0, Windows and Linux: typecheck passes; lint has no errors and one existing warning in speech.test.ts.
  • Loader/resolver tests: 17 pass. Two independent automated blind reviews found no actionable issues; their broader focused runs passed 37 and 59 tests respectively.
  • Linux production build, compiled CLI build, and mmx --version pass.
  • Full Linux run: 600 passed, 3 failed. The unchanged a965e72 baseline has 596 passed and the same 3 failures: the unreachable-region tests in timeout-fix.test.ts and auth/login.test.ts time out, and the FileSDK upload test sees a loopback base URL instead of the global host. Their root causes are not established here. Both full runs used the same validation-only fetch preload rejecting non-loopback requests; repository tests and timeouts were not changed.

No live MiniMax model/API calls were used to validate this fix. Implemented and tested with Codex assistance; the blind reviews were automated, not independent human review.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@ch-z-hc
ch-z-hc marked this pull request as ready for review October 14, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant