Skip to content

fix(providers): switch MiniMax API-key provider to anthropic-messages - #15297

Merged
gumadeiras merged 2 commits into
openclaw:mainfrom
lailoo:fix/minimax-api-type-15275
Feb 13, 2026
Merged

gumadeiras merged 2 commits into
openclaw:mainfrom
lailoo:fix/minimax-api-type-15275

Conversation

@lailoo

@lailoo lailoo commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

buildMinimaxProvider() in models-config.providers.ts defaults to api: "openai-completions" at baseUrl: "https://api.minimax.chat/v1", but MiniMax M2.5 (and all current MiniMax models) requires api: "anthropic-messages" at https://api.minimax.io/anthropic.

This causes invalid role: developer (2013) errors when users configure MiniMax via API key without going through the onboarding wizard.

Root Cause

buildMinimaxProvider() (used by resolveImplicitProviders for API-key auth) had:

  • api: "openai-completions" ❌
  • baseUrl: "https://api.minimax.chat/v1" ❌

While buildMinimaxPortalProvider() (used for OAuth) and applyMinimaxApiProviderConfig() (onboarding wizard) both correctly use:

  • api: "anthropic-messages" ✅
  • baseUrl: "https://api.minimax.io/anthropic" ✅

Fix

Switch buildMinimaxProvider() to use MINIMAX_PORTAL_BASE_URL (https://api.minimax.io/anthropic) and api: "anthropic-messages", aligning it with the portal provider and onboarding config. Remove the now-unused MINIMAX_API_BASE_URL constant.

Test

Before (on main)

× should use anthropic-messages API for API-key provider
  Expected: "anthropic-messages"
  Received: "openai-completions"
Tests: 1 failed

After (on fix branch)

✓ should use anthropic-messages API for API-key provider
Tests: 1 passed

All 46 provider + onboard-auth tests pass.

Closes #15275

Greptile Overview

Greptile Summary

This PR aligns the implicit MiniMax API-key provider created by resolveImplicitProviders with the already-correct OAuth/onboarding paths by switching MiniMax to use the Anthropic-compatible endpoint.

Concretely, buildMinimaxProvider() in src/agents/models-config.providers.ts now uses api: "anthropic-messages" and the https://api.minimax.io/anthropic base URL (via MINIMAX_PORTAL_BASE_URL), and removes the now-unused MINIMAX_API_BASE_URL constant. A new Vitest regression test (src/agents/models-config.providers.minimax.test.ts) asserts that when MINIMAX_API_KEY is set, the implicit provider configuration uses the correct API and baseUrl, preventing the reported invalid role: developer (2013) errors.

No merge-blocking issues found in the changes.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are small, localized, and bring the implicit MiniMax provider into alignment with existing portal/onboarding configuration. A targeted regression test was added. No broken references were found after verifying other MiniMax base URL constants are defined in separate modules.
  • No files require special attention

Last reviewed commit: 5f16219

@gumadeiras gumadeiras self-assigned this Feb 13, 2026
@gumadeiras
gumadeiras force-pushed the fix/minimax-api-type-15275 branch from 83c0b2b to 7eb45a4 Compare February 13, 2026 19:43
@gumadeiras
gumadeiras force-pushed the fix/minimax-api-type-15275 branch from 7eb45a4 to 0e7f84a Compare February 13, 2026 19:43
@gumadeiras
gumadeiras merged commit f24d70e into openclaw:main Feb 13, 2026
9 checks passed
@gumadeiras

Copy link
Copy Markdown
Member

Merged via squash.

Thanks @lailoo!

GwonHyeok pushed a commit to learners-superpumped/openclaw that referenced this pull request Feb 15, 2026
…openclaw#15297)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0e7f84a
Co-authored-by: lailoo <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
mf-yang added a commit to mf-yang/openclaw-cn that referenced this pull request Feb 15, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…openclaw#15297)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0e7f84a
Co-authored-by: lailoo <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…openclaw#15297)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0e7f84a
Co-authored-by: lailoo <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…openclaw#15297)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0e7f84a
Co-authored-by: lailoo <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
…openclaw#15297)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0e7f84a
Co-authored-by: lailoo <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MiniMax API key provider defaults to wrong API type — causes 'invalid role: developer (2013)'

2 participants