@@ -11,6 +11,7 @@ import { applyClaudeModelPicker, readClaudeModelPicker } from "./ClaudeModelPick
1111const builtIn = ( slug : string ) : ServerProviderModel => ( {
1212 slug,
1313 name : `Built-in ${ slug } ` ,
14+ shortName : `Short ${ slug } ` ,
1415 isCustom : false ,
1516 capabilities : createModelCapabilities ( { optionDescriptors : [ ] } ) ,
1617} ) ;
@@ -25,14 +26,15 @@ const writeSettings = Effect.fn(function* (settings: string) {
2526} ) ;
2627
2728it . layer ( NodeServices . layer ) ( "Claude modelPicker" , ( it ) => {
28- it . effect ( "lists picker rows first and keeps bundled models' own controls" , ( ) =>
29+ it . effect ( "lists picker rows first and keeps bundled models' controls under their label " , ( ) =>
2930 Effect . gen ( function * ( ) {
3031 const claudeSettings = yield * writeSettings (
3132 JSON . stringify ( {
3233 modelPicker : {
3334 options : [
3435 { model : "deepseek/deepseek-v4-pro" , label : "DeepSeek V4 Pro" } ,
35- { model : "claude-other" , label : "ignored for bundled models" } ,
36+ { model : "claude-other" , label : "Work Claude" } ,
37+ { model : "claude-known" } ,
3638 { model : "kimi/kimi-k2.6" } ,
3739 { model : "deepseek/deepseek-v4-pro" , label : "duplicate" } ,
3840 { model : " " } ,
@@ -49,12 +51,14 @@ it.layer(NodeServices.layer)("Claude modelPicker", (it) => {
4951 models . map ( ( model ) => [ model . slug , model . name , model . isCustom ] ) ,
5052 [
5153 [ "deepseek/deepseek-v4-pro" , "DeepSeek V4 Pro" , false ] ,
52- [ "claude-other" , "Built-in claude-other" , false ] ,
53- [ "kimi/kimi-k2.6" , "kimi/kimi-k2.6" , false ] ,
54+ [ "claude-other" , "Work Claude" , false ] ,
5455 [ "claude-known" , "Built-in claude-known" , false ] ,
56+ [ "kimi/kimi-k2.6" , "kimi/kimi-k2.6" , false ] ,
5557 ] ,
5658 ) ;
57- assert . strictEqual ( models [ 1 ] , builtInModels [ 1 ] ) ;
59+ assert . strictEqual ( models [ 1 ] ?. capabilities , builtInModels [ 1 ] ?. capabilities ) ;
60+ assert . isUndefined ( models [ 1 ] ?. shortName ) ;
61+ assert . strictEqual ( models [ 2 ] , builtInModels [ 0 ] ) ;
5862 assert . isNull ( models [ 0 ] ?. capabilities ) ;
5963 } ) ,
6064 ) ;
@@ -82,10 +86,15 @@ it.layer(NodeServices.layer)("Claude modelPicker", (it) => {
8286 it . effect ( "leaves the built-in list alone without a usable modelPicker" , ( ) =>
8387 Effect . gen ( function * ( ) {
8488 const malformed = yield * writeSettings ( "{ modelPicker: { options: 'nope' }, }" ) ;
89+ const unusableRows = yield * writeSettings (
90+ JSON . stringify ( {
91+ modelPicker : { replaceBuiltInOptions : true , options : [ { model : " " } , { label : "x" } ] } ,
92+ } ) ,
93+ ) ;
8594 const absent = yield * writeSettings ( "{}" ) ;
8695 const missing = { homePath : `${ absent . homePath } /missing` } ;
8796
88- for ( const claudeSettings of [ malformed , absent , missing ] ) {
97+ for ( const claudeSettings of [ malformed , unusableRows , absent , missing ] ) {
8998 const picker = yield * readClaudeModelPicker ( claudeSettings , { } ) ;
9099 assert . strictEqual ( applyClaudeModelPicker ( builtInModels , picker ) , builtInModels ) ;
91100 }
0 commit comments