Skip to content

fix(reflection): recognize MiniMax regional endpoint and align provider id - #975

Open
octo-patch wants to merge 1 commit into
CortexReach:masterfrom
octo-patch:octo/20260729-parameter-refresh-recvq9YsG0ICzn
Open

fix(reflection): recognize MiniMax regional endpoint and align provider id#975
octo-patch wants to merge 1 commit into
CortexReach:masterfrom
octo-patch:octo/20260729-parameter-refresh-recvq9YsG0ICzn

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: MiniMax reflection provider inference ignored the regional api.minimaxi.com endpoint and returned a provider id inconsistent with the explicit model-reference path, making bare-name configuration region-dependent.

What changed

  • inferProviderFromBaseURL now recognizes both MiniMax base URLs — api.minimax.io (global) and api.minimaxi.com (regional) — using the existing "." + suffix endsWith guard that blocks host spoofing (e.g. fake-minimax.io, fake-minimaxi.com).
  • It now returns the minimax provider id, matching the id parsed from an explicit minimax/<model> reference in splitProviderModel, so a bare model name such as MiniMax-M3 or MiniMax-M2.7 resolves to the same provider regardless of the configured region.

Why

The global host previously mapped to minimax-portal while the explicit model-reference path used minimax, and the regional host was not matched at all. Bare-name reflection configuration was therefore region-dependent and inconsistent between the two resolution branches (split.provider ?? inferProviderFromBaseURL(...)).

Tests

  • Extended test/infer-provider-from-baseurl.test.mjs with the updated provider id, both regional hosts (/v1 and /anthropic base URLs), and fake-minimaxi.com spoofing protection.
  • node --test test/infer-provider-from-baseurl.test.mjs — 13/13 pass.
  • npx tsc -p tsconfig.json --noEmit — passes.

…er id

inferProviderFromBaseURL only matched the global api.minimax.io host and
returned "minimax-portal", while an explicit "minimax/<model>" reference
resolves the provider id to "minimax". The regional api.minimaxi.com host was
not matched at all, so a bare model name (e.g. MiniMax-M3, MiniMax-M2.7)
resolved to a different provider id depending on the configured region.

Match both api.minimax.io and api.minimaxi.com with the existing "." + suffix
spoofing guard and return "minimax" so bare-name reflection configuration is
region-independent and consistent with the explicit modelRef path. Extend the
regression test to cover both regional hosts and spoofing protection.

@rwmjhb rwmjhb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 43a9711. The source-level targeted tests and full suite pass, but the published runtime does not contain this fix.

index.ts now recognizes .minimaxi.com and returns minimax, while the tracked dist/index.js at this same head still recognizes only .minimax.io and returns minimax-portal. package.json.main points installed plugins at dist/index.js, and this PR changes only index.ts plus the source-oriented test. As submitted, repository tests pass but installed/published users continue executing the old behavior.

Please run the project build, commit the resulting dist/index.js, and run npm run verify-package-runtime (or the equivalent package dry-run) so the generated delivery artifact is verified. A focused packaged-runtime assertion for both MiniMax hostnames would prevent this source/dist split from recurring.

Non-blocking compatibility follow-up: the existing .minimax.io return value changes from minimax-portal to minimax; an end-to-end provider consumer test would make that intentional contract change safer than helper-only expectations.

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.

2 participants