Skip to content

feat(ai): add MiniMax provider for global and China Anthropic Messages endpoints - #222

Merged
EyJunge1 merged 2 commits into
tickernelz:mainfrom
octo-patch:octo/20260730--recvqepZ4MOsVs
Aug 2, 2026
Merged

feat(ai): add MiniMax provider for global and China Anthropic Messages endpoints#222
EyJunge1 merged 2 commits into
tickernelz:mainfrom
octo-patch:octo/20260730--recvqepZ4MOsVs

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Reason: Add a validated MiniMax provider preset for the global and China Anthropic Messages endpoints and current MiniMax text models.

Changes

  • Add MiniMaxProvider (src/services/ai/providers/minimax.ts) that reuses the Anthropic Messages request/response handling and overrides the endpoint resolution and session provider tag.
  • MiniMax exposes an Anthropic Messages-compatible endpoint at <base>/anthropic/v1/messages authenticated with the x-api-key header, on both the global host (https://api.minimax.io) and the China host (https://api.minimaxi.com). The provider normalizes a configured memoryApiUrl base URL so it can be supplied with or without a trailing /anthropic or /anthropic/v1 suffix, then targets /anthropic/v1/messages and keeps the x-api-key + anthropic-version headers from the shared base.
  • Refactor AnthropicMessagesProvider to expose sessionProviderTag() and resolveEndpoint() hooks (plus diagnostic log-label hooks) so an Anthropic-compatible gateway records its own provider tag and request URL while sharing the message/tool-call flow; Anthropic behavior is unchanged.
  • Wire the "minimax" provider type through AIProviderFactory.createProvider / getSupportedProviders, the AIProviderType union (session-types.ts and types/index.ts), and the memoryProvider config types in config.ts.
  • Document the minimax provider mode and the global/China base URLs in the config template and README.

Unlike the closed prior attempt, this adds a source-level provider for both the global and China endpoints, uses the current /anthropic/v1/messages endpoint (not a /anthropic/v1 alias on a single CN host), keeps the current x-api-key auth scheme, and includes tests.

Tests

  • bun test tests/minimax-provider.test.ts tests/anthropic-provider.test.ts tests/ai-provider-config.test.ts tests/openai-chat-completion-provider.test.ts tests/config.test.ts tests/config-resolution.test.ts — all passing.
  • bunx tsc --noEmit — clean.
  • prettier --check on changed files — clean.

New tests/minimax-provider.test.ts covers endpoint resolution for the global host, the China host, base URLs that already include /anthropic or /anthropic/v1, trailing-slash normalization, the missing-URL guard, x-api-key + anthropic-version header emission, request body model/max_tokens, tool-use extraction from an Anthropic-format response, and factory wiring.

octo-patch and others added 2 commits August 2, 2026 20:55
Apply safe memoryExtraParams on the shared Anthropic Messages path so
MiniMax adaptive thinking works as documented, normalize full
/anthropic/v1/messages base URLs without duplication, and cover the
session tag plus request forwarding in regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EyJunge1
EyJunge1 force-pushed the octo/20260730--recvqepZ4MOsVs branch from 65df6bc to 0914d2d Compare August 2, 2026 18:57
@EyJunge1
EyJunge1 merged commit c3ba090 into tickernelz:main Aug 2, 2026
7 checks passed
@EyJunge1 EyJunge1 mentioned this pull request Aug 2, 2026
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