Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
addCacheBreakpoints,
enableReasoningSummaries,
fixResponsesRequest,
isReasoningExplicitlyEnabled,
scrubOpenCodeSpecificProperties,
} from '@/lib/ai-gateway/providers/openrouter/request-helpers';
import { isQwenExplicitCacheModel, isQwenModel } from '@/lib/ai-gateway/providers/qwen';
Expand Down Expand Up @@ -180,6 +181,16 @@ export function applyProviderSpecificLogic(
addCacheBreakpoints(requestToMutate);
}

if (
isMinimaxModel(requestedModel) &&
!isReasoningExplicitlyEnabled(requestToMutate) &&
requestToMutate.kind === 'messages'
) {
// MiniMax defaults to thinking, but the Anthropic provider does not include thinking:disabled in the request, creating a mismatch.
// https://github.com/vercel/ai/blob/4a441d8fb584b231f771348de3e7f383ab7aa95b/packages/anthropic/src/anthropic-language-model.ts#L421-L453
requestToMutate.body.thinking = { type: 'disabled' };
}

provider.transformRequest({
provider,
model: requestedModel,
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/lib/ai-gateway/providers/model-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ export function getAiSdkProvider(
if (isOpenCodeGoAnthropicMessagesModel(model)) {
return 'anthropic';
}
if (isClaudeModel(model)) {
// on Vercel AI Gateway, this is necessary to support document attachments
if (
isClaudeModel(model) || // on Vercel AI Gateway, this is necessary to support document attachments
isMinimaxModel(model) // on Vercel AI Gateway, this is necessary for reasoning to show
) {
return 'anthropic';
}
if (isOpenAiModel(model) || isGrokModel(model)) {
Expand Down