Skip to content

Commit 0819e47

Browse files
authored
fix(agent): declare MiniMax native effort levels and no temperature for Pi and OpenCode (#298)
Co-authored-by: SaladDay <saladday@users.noreply.github.com>
1 parent d91a24c commit 0819e47

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎src/agent/configurator.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ function prepareOpenCode(options: AgentSetupOptions, path: string): PreparedAgen
794794
return [
795795
{ path: ['provider', 'minimax', 'models', model.id, 'name'], value: model.id },
796796
{ path: ['provider', 'minimax', 'models', model.id, 'reasoning'], value: true },
797-
{ path: ['provider', 'minimax', 'models', model.id, 'temperature'], value: true },
797+
{ path: ['provider', 'minimax', 'models', model.id, 'temperature'], value: false },
798798
{
799799
path: ['provider', 'minimax', 'models', model.id, 'attachment'],
800800
value: input.includes('image'),
@@ -911,8 +911,12 @@ function preparePi(options: AgentSetupOptions, paths: string[]): PreparedAgentFi
911911
name: model.id,
912912
reasoning: true,
913913
...(model.id === 'MiniMax-M3'
914-
? { compat: { forceAdaptiveThinking: true } }
915-
: { thinkingLevelMap: { off: null } }),
914+
? { compat: { forceAdaptiveThinking: true, supportsTemperature: false } }
915+
: {
916+
// Always thinks (no off level); effort low..max via output_config.effort; no temperature.
917+
compat: { forceAdaptiveThinking: true, supportsTemperature: false },
918+
thinkingLevelMap: { off: null, minimal: null, xhigh: 'xhigh', max: 'max' },
919+
}),
916920
input: [...model.input],
917921
contextWindow: model.contextWindow,
918922
maxTokens: model.maxTokens,

‎test/agent/configurator.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,14 @@ describe('agent configurator', () => {
260260
expect(openCode.provider.minimax.models['keep-model']).toEqual({ name: 'Keep' });
261261
expect(openCode.provider.minimax.models['MiniMax-M3'].custom).toBe(true);
262262
expect(openCode.provider.minimax.models['MiniMax-M3'].attachment).toBe(true);
263+
expect(openCode.provider.minimax.models['MiniMax-M3'].temperature).toBe(false);
263264
expect(openCode.provider.minimax.models['MiniMax-M3'].modalities)
264265
.toEqual({ input: ['text', 'image'], output: ['text'] });
265266
expect(openCode.provider.minimax.models['MiniMax-M3'].limit)
266267
.toEqual({ context: 1_000_000, output: 128000 });
267268
const m31OpenCode = openCode.provider.minimax.models['MiniMax-M3.1-Flash'];
268269
expect(m31OpenCode.reasoning).toBe(true);
269-
expect(m31OpenCode.temperature).toBe(true);
270+
expect(m31OpenCode.temperature).toBe(false);
270271
expect(m31OpenCode.interleaved).toEqual({ field: 'reasoning_content' });
271272
expect(m31OpenCode.variants.default.reasoningEffort).toBe('max');
272273
expect(m31OpenCode.variants.none.disabled).toBe(true);
@@ -310,8 +311,11 @@ describe('agent configurator', () => {
310311
});
311312
expect(piModels.providers['minimax-cn'].models[1].thinkingLevelMap).toBeUndefined();
312313
expect(piModels.providers['minimax-cn'].models[1].compat)
313-
.toEqual({ supportsStrictTools: true, forceAdaptiveThinking: true });
314-
expect(piModels.providers['minimax-cn'].models[2].thinkingLevelMap).toEqual({ off: null });
314+
.toEqual({ supportsStrictTools: true, forceAdaptiveThinking: true, supportsTemperature: false });
315+
expect(piModels.providers['minimax-cn'].models[2].thinkingLevelMap)
316+
.toEqual({ off: null, minimal: null, xhigh: 'xhigh', max: 'max' });
317+
expect(piModels.providers['minimax-cn'].models[2].compat)
318+
.toEqual({ forceAdaptiveThinking: true, supportsTemperature: false });
315319
expect(piModels.providers['minimax-cn'].api).toBe('anthropic-messages');
316320
expect(piModels.providers['minimax-cn'].baseUrl).toBe('https://api.minimax.cn/anthropic');
317321
expect(piModels.providers['minimax-cn'].models.map((model: { id: string }) => model.id))

0 commit comments

Comments
 (0)