Repository navigation
fix: scope OAuth resource URL to OAuth credentials - #284
Merged
Merged
Conversation
ch-z-hc
marked this pull request as ready for review
October 14, 2026 08:22
NianJiuZst
self-requested a review
October 16, 2026 17:53
NianJiuZst
reviewed
Oct 16, 2026
NianJiuZst
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed commit dc61fe89df77f6e7aebe6205202b3cedeb4f478c. No blocking findings; I recommend merging.
The loader now correctly excludes the saved OAuth resource URL when an explicit API key selects API-key authentication. Explicit base-URL overrides retain precedence, and OAuth still wins over a stored API key when no explicit key is supplied.
I independently verified that the two regional regressions fail on unchanged main (8668aa5) and pass with this patch. All 17 loader/resolver tests pass, including the OAuth-plus-stored-key and custom-base-URL controls. Type checking and lint pass, with the existing unrelated warning in test/sdk/speech.test.ts. The CI workflow for this exact head also passes.
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.
Bug
With OAuth credentials saved in
config.json,--api-keycorrectly selects the supplied key, butloadConfig()still takes the base URL fromoauth.resource_url. An explicit--region globalor--region cntherefore 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
speech.test.ts.mmx --versionpass.a965e72baseline has 596 passed and the same 3 failures: the unreachable-region tests intimeout-fix.test.tsandauth/login.test.tstime 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.
Need help on this PR? Tag
@codesmith-botwith what you need.