Skip to content

Commit 2d18e7c

Browse files
committed
Mark legacy free model as free
1 parent 0f8fc5f commit 2d18e7c

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

src/lib/kilo-auto-model.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,17 @@ const BALANCED_MODE_TO_MODEL = new Map<string, ResolvedAutoModel>([
167167
['code', BALANCED_CODE_MODEL],
168168
]);
169169

170-
const legacyMapping: Record<string, string | undefined> = {
171-
'kilo/auto': KILO_AUTO_FRONTIER_MODEL.id,
172-
'kilo/auto-free': KILO_AUTO_FREE_MODEL.id,
173-
'kilo/auto-small': KILO_AUTO_SMALL_MODEL.id,
170+
export const KILO_AUTO_FREE_MODEL_DEPRECATED = 'kilo/auto-free';
171+
172+
const legacyMapping: Record<string, AutoModel | undefined> = {
173+
'kilo/auto': KILO_AUTO_FRONTIER_MODEL,
174+
[KILO_AUTO_FREE_MODEL_DEPRECATED]: KILO_AUTO_FREE_MODEL,
175+
'kilo/auto-small': KILO_AUTO_SMALL_MODEL,
174176
};
175177

176178
export function deprecatedAutoModelsToPreventNewExtensionModelPickerFromGettingStuck(): AutoModel[] {
177179
return Object.entries(legacyMapping)
178-
.map(([legacyId, currentId]) => {
179-
const model = AUTO_MODELS.find(m => m.id === currentId);
180+
.map(([legacyId, model]) => {
180181
if (!model) return null;
181182
return {
182183
...model,
@@ -189,7 +190,7 @@ export function deprecatedAutoModelsToPreventNewExtensionModelPickerFromGettingS
189190
}
190191

191192
export function resolveAutoModel(model: string, modeHeader: string | null): ResolvedAutoModel {
192-
const mappedModel = legacyMapping[model] ?? model;
193+
const mappedModel = legacyMapping[model]?.id ?? model;
193194
if (mappedModel === KILO_AUTO_FREE_MODEL.id) {
194195
return { model: minimax_m25_free_model.public_id };
195196
}

src/lib/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import {
66
KILO_AUTO_BALANCED_MODEL,
77
KILO_AUTO_FREE_MODEL,
8+
KILO_AUTO_FREE_MODEL_DEPRECATED,
89
KILO_AUTO_FRONTIER_MODEL,
910
} from '@/lib/kilo-auto-model';
1011
import {
@@ -43,6 +44,7 @@ export function isFreeModel(model: string): boolean {
4344
return (
4445
kiloFreeModels.some(m => m.public_id === model && m.is_enabled) ||
4546
model === KILO_AUTO_FREE_MODEL.id ||
47+
model === KILO_AUTO_FREE_MODEL_DEPRECATED ||
4648
(model ?? '').endsWith(':free') ||
4749
model === 'openrouter/free' ||
4850
isOpenRouterStealthModel(model ?? '')

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
"internal_reasoning": "0"
276276
},
277277
"context_length": 200000,
278+
"isFree": false,
278279
"opencode": {
279280
"variants": {
280281
"none": {
@@ -311,8 +312,7 @@
311312
"verbosity": "max"
312313
}
313314
}
314-
},
315-
"isFree": false
315+
}
316316
},
317317
{
318318
"id": "anthropic/claude-3.7-sonnet",
@@ -342,6 +342,7 @@
342342
"internal_reasoning": "0"
343343
},
344344
"context_length": 200000,
345+
"isFree": false,
345346
"opencode": {
346347
"variants": {
347348
"none": {
@@ -378,8 +379,7 @@
378379
"verbosity": "max"
379380
}
380381
}
381-
},
382-
"isFree": false
382+
}
383383
},
384384
{
385385
"id": "google/gemini-2.5-pro",
@@ -409,6 +409,7 @@
409409
"internal_reasoning": "0"
410410
},
411411
"context_length": 1000000,
412+
"isFree": false,
412413
"versioned_settings": {
413414
"4.146.0": {
414415
"included_tools": [
@@ -419,8 +420,7 @@
419420
"apply_diff"
420421
]
421422
}
422-
},
423-
"isFree": false
423+
}
424424
},
425425
{
426426
"id": "openai/gpt-4.1",
@@ -450,6 +450,7 @@
450450
"internal_reasoning": "0"
451451
},
452452
"context_length": 128000,
453+
"isFree": false,
453454
"settings": {
454455
"included_tools": [
455456
"apply_patch"
@@ -494,8 +495,7 @@
494495
}
495496
}
496497
}
497-
},
498-
"isFree": false
498+
}
499499
},
500500
{
501501
"id": "some-other-model",
@@ -639,6 +639,7 @@
639639
"tools"
640640
],
641641
"default_parameters": {},
642+
"isFree": true,
642643
"versioned_settings": {
643644
"4.146.0": {
644645
"included_tools": [
@@ -649,8 +650,7 @@
649650
"apply_diff"
650651
]
651652
}
652-
},
653-
"isFree": true
653+
}
654654
},
655655
{
656656
"id": "morph-warp-grep-v2",
@@ -865,7 +865,7 @@
865865
"edit_file"
866866
]
867867
},
868-
"isFree": false
868+
"isFree": true
869869
},
870870
{
871871
"id": "kilo/auto-small",

0 commit comments

Comments
 (0)