@@ -13,6 +13,10 @@ import {
1313} from "openclaw/plugin-sdk/provider-auth" ;
1414import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/provider-auth" ;
1515import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key" ;
16+ import {
17+ buildOpenAICompatibleReplayPolicy ,
18+ buildStrictAnthropicReplayPolicy ,
19+ } from "openclaw/plugin-sdk/provider-model-shared" ;
1620import { createMinimaxFastModeWrapper } from "openclaw/plugin-sdk/provider-stream" ;
1721import { fetchMinimaxUsage } from "openclaw/plugin-sdk/provider-usage" ;
1822import { isMiniMaxModernModelId , MINIMAX_DEFAULT_MODEL_ID } from "./api.js" ;
@@ -46,29 +50,12 @@ function buildMinimaxReplayPolicy(
4650) : ProviderReplayPolicy | undefined {
4751 if ( ctx . modelApi === "anthropic-messages" || ctx . modelApi === "bedrock-converse-stream" ) {
4852 const modelId = ctx . modelId ?. toLowerCase ( ) ?? "" ;
49- return {
50- sanitizeMode : "full" ,
51- sanitizeToolCallIds : true ,
52- toolCallIdMode : "strict" ,
53- preserveSignatures : true ,
54- repairToolUseResultPairing : true ,
55- validateAnthropicTurns : true ,
56- allowSyntheticToolResults : true ,
57- ...( modelId . includes ( "claude" ) ? { dropThinkingBlocks : true } : { } ) ,
58- } ;
59- }
60-
61- if ( ctx . modelApi === "openai-completions" ) {
62- return {
63- sanitizeToolCallIds : true ,
64- toolCallIdMode : "strict" ,
65- applyAssistantFirstOrderingFix : true ,
66- validateGeminiTurns : true ,
67- validateAnthropicTurns : true ,
68- } ;
53+ return buildStrictAnthropicReplayPolicy ( {
54+ dropThinkingBlocks : modelId . includes ( "claude" ) ,
55+ } ) ;
6956 }
7057
71- return undefined ;
58+ return buildOpenAICompatibleReplayPolicy ( ctx . modelApi ) ;
7259}
7360
7461function getDefaultBaseUrl ( region : MiniMaxRegion ) : string {
0 commit comments