@@ -44,13 +44,62 @@ describe("mobile model options", () => {
4444 providerKey : "codex" ,
4545 providerLabel : "Codex" ,
4646 models : [
47- { key : "codex:gpt-5.6-sol" , label : "GPT-5.6 Sol" , isLegacy : false } ,
47+ { key : "codex:gpt-5.6-sol" , label : "GPT-5.6 Sol" , subtitle : "" , isLegacy : false } ,
4848 { key : "codex:gpt-5.4" , label : "GPT-5.4" , isLegacy : true } ,
4949 ] ,
5050 } ,
5151 ] ) ;
5252 } ) ;
5353
54+ it ( "distinguishes same-name OpenCode models without changing their routing" , ( ) => {
55+ const sources = [
56+ { id : "anthropic" , label : "Anthropic" } ,
57+ { id : "github-copilot" , label : "GitHub Copilot" } ,
58+ { id : "opencode" , label : "OpenCode Zen" } ,
59+ ] ;
60+ const config = {
61+ providers : [
62+ {
63+ instanceId : "opencode_work" ,
64+ driver : "opencode" ,
65+ displayName : "OpenCode Work" ,
66+ enabled : true ,
67+ installed : true ,
68+ auth : { status : "authenticated" } ,
69+ models : sources . map ( ( source ) => ( {
70+ slug : `${ source . id } /claude-fable-5` ,
71+ name : "Claude Fable 5" ,
72+ subProvider : source . label ,
73+ isCustom : false ,
74+ capabilities : null ,
75+ } ) ) ,
76+ } ,
77+ ] ,
78+ } as unknown as ServerConfig ;
79+ const selection = {
80+ instanceId : ProviderInstanceId . make ( "opencode_work" ) ,
81+ model : "github-copilot/claude-fable-5" ,
82+ } ;
83+
84+ const options = buildModelOptions ( config , selection ) ;
85+
86+ expect ( options ) . toMatchObject (
87+ sources . map ( ( source ) => ( {
88+ key : `opencode_work:${ source . id } /claude-fable-5` ,
89+ label : "Claude Fable 5" ,
90+ subtitle : source . label ,
91+ providerLabel : "OpenCode Work" ,
92+ selection : {
93+ instanceId : "opencode_work" ,
94+ model : `${ source . id } /claude-fable-5` ,
95+ } ,
96+ } ) ) ,
97+ ) ;
98+ expect ( groupByProvider ( options ) ) . toEqual ( [
99+ { providerKey : "opencode_work" , providerLabel : "OpenCode Work" , models : options } ,
100+ ] ) ;
101+ } ) ;
102+
54103 it ( "normalizes a legacy fallback selection against current capabilities" , ( ) => {
55104 const config = {
56105 providers : [
0 commit comments