-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: migrate MiniMax provider to AI SDK #11357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
- Rewrite minimax.ts from raw @anthropic-ai/sdk to @ai-sdk/anthropic with createAnthropic(), streamText(), generateText() - Use shared transform layer (convertToAiSdkMessages, processAiSdkStreamPart, handleAiSdkError) for all message/stream/error handling - Preserve base URL conversion logic (/v1 -> /anthropic/v1) with /v1 suffix for correct @ai-sdk/anthropic path construction - Add thinking signature capture (lastThoughtSignature, getThoughtSignature, getRedactedThinkingBlocks) matching anthropic.ts pattern for proper interleaved thinking round-trip - Preserve mergeEnvironmentDetailsForMiniMax preprocessing - Prompt caching via providerOptions.anthropic.cacheControl - isAiSdkProvider() returns true - Rewrite minimax.spec.ts with AI SDK mocks (21/21 tests pass)
Contributor
Both previously flagged issues have been addressed. No new issues found.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
…yApiConfiguration - Add convertToolsForOpenAI preprocessing before convertToolsForAiSdk to handle MCP tool detection and schema normalization - Remove LegacyApiConfiguration type and getLegacyApiConfiguration() - Read options directly from flat ProviderSettings shape - Update tests to use real ProviderSettings instead of apiConfiguration
daniel-lxs
approved these changes
Feb 10, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:XXL
This PR changes 1000+ lines, ignoring generated files.
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.
Summary
Migrates the MiniMax provider from raw
@anthropic-ai/sdkusage to the AI SDK (@ai-sdk/anthropicwith custom baseURL), following the Archetype 3 migration pattern established by the Anthropic handler.Changes
minimax.ts: Replace raw Anthropic SDK client withcreateAnthropic()+streamText()/generateText()and shared transform layer (convertToAiSdkMessages,processAiSdkStreamPart,handleAiSdkError)/anthropic/v1since@ai-sdk/anthropicappends/messagesdirectly (not/v1/messageslike the raw Anthropic SDK)lastThoughtSignature,getThoughtSignature(), andgetRedactedThinkingBlocks()matching theanthropic.tspattern — critical for MiniMax interleaved thinking round-tripproviderOptions.anthropic.cacheControl(AI SDK native) instead of manualcache_controlblocksisAiSdkProvider(): Returnstruefor proper reasoning block preservation in conversation historymergeEnvironmentDetailsForMiniMax: Applied beforeconvertToAiSdkMessages()to maintain tool result merging behaviorminimax.spec.ts: Full test rewrite with AI SDK mocks — 21/21 tests passImportant
Migrates MiniMax provider to AI SDK, refactoring URL handling, message streaming, and error management, with updated tests.
minimax.tsusingcreateAnthropic(),streamText(), andgenerateText()./anthropic/v1.getThoughtSignature()andgetRedactedThinkingBlocks()for capturing and retrieving thought signatures and redacted thinking blocks.isAiSdkProvider()to returntrue.handleAiSdkError()for error management.providerOptions.anthropic.cacheControl.minimax.spec.tsto mock AI SDK functions and verify new behavior.This description was created by
for f470c71. You can customize this summary. It will automatically update as commits are pushed.