Skip to content

Commit 8723601

Browse files
authored
fix(gateway): expose MiMo model variants to OpenCode clients (#1644)
## Summary - Xiaomi MiMo models (`xiaomi/mimo-v2-pro:free` and `xiaomi/mimo-v2-omni:free`) were missing `opencode.variants` configuration, causing OpenCode clients on Kilo Gateway to not properly recognize or surface these reasoning models. - Added `isXiaomiModel` to the variant detection in `getModelVariants()` so MiMo models now expose `instant` (reasoning disabled) and `thinking` (reasoning enabled) variants, matching the pattern used by other reasoning models like Moonshot and ZAI. - Updated the approved test snapshot to reflect the new opencode variant settings for both MiMo models. Closes #1641 ## Verification - [x] `pnpm typecheck` — passed, no errors - [x] Manual review of `getOpenCodeSettings()` flow confirms MiMo models now return `{ variants: { instant: ..., thinking: ... } }` instead of `{}` ## Visual Changes N/A ## Reviewer Notes - The fix adds `isXiaomiModel(model)` to the existing `isMoonshotModel(model) || isZaiModel(model)` branch in `getModelVariants()` (`src/lib/providers/model-settings.ts:66`), giving MiMo models the same `instant`/`thinking` variant structure as other reasoning-capable models. - Both MiMo models were already registered in `kiloFreeModels` with `status: 'public'` and the `'reasoning'` flag — the only missing piece was the opencode variant configuration that tells clients how to toggle reasoning.
2 parents 401dc60 + b84e035 commit 8723601

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

src/lib/providers/model-settings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { isMoonshotModel } from '@/lib/providers/moonshotai';
55
import { isOpenAiModel } from '@/lib/providers/openai';
66
import { qwen35_plus_free_model } from '@/lib/providers/qwen';
77
import { grok_code_fast_1_optimized_free_model } from '@/lib/providers/xai';
8+
import { isXiaomiModel } from '@/lib/providers/xiaomi';
89
import { isZaiModel } from '@/lib/providers/zai';
910
import type {
1011
CustomLlmProvider,
@@ -62,7 +63,7 @@ export function getModelVariants(model: string): OpenCodeSettings['variants'] {
6263
efforts.map(effort => [effort, { reasoning: { enabled: effort !== 'none', effort } }])
6364
);
6465
}
65-
if (isMoonshotModel(model) || isZaiModel(model)) {
66+
if (isMoonshotModel(model) || isZaiModel(model) || isXiaomiModel(model)) {
6667
return {
6768
instant: { reasoning: { enabled: false } },
6869
thinking: { reasoning: { enabled: true } },

src/tests/openrouter-models-sorting.approved.json

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,20 @@
189189
"default_parameters": {},
190190
"preferredIndex": 3,
191191
"isFree": true,
192-
"opencode": {}
192+
"opencode": {
193+
"variants": {
194+
"instant": {
195+
"reasoning": {
196+
"enabled": false
197+
}
198+
},
199+
"thinking": {
200+
"reasoning": {
201+
"enabled": true
202+
}
203+
}
204+
}
205+
}
193206
},
194207
{
195208
"id": "anthropic/claude-sonnet-4",
@@ -644,7 +657,20 @@
644657
],
645658
"default_parameters": {},
646659
"isFree": true,
647-
"opencode": {}
660+
"opencode": {
661+
"variants": {
662+
"instant": {
663+
"reasoning": {
664+
"enabled": false
665+
}
666+
},
667+
"thinking": {
668+
"reasoning": {
669+
"enabled": true
670+
}
671+
}
672+
}
673+
}
648674
},
649675
{
650676
"id": "x-ai/grok-code-fast-1:optimized:free",

0 commit comments

Comments
 (0)