@@ -97,6 +97,65 @@ describe("composer model option summary", () => {
9797 expect ( summary ( ) ) . toEqual ( { reasoningLabel : "Medium" , speedLabel : undefined } ) ;
9898 } ) ;
9999
100+ const openCodeCapabilities : ModelCapabilities = {
101+ optionDescriptors : [
102+ {
103+ id : "variant" ,
104+ label : "Reasoning" ,
105+ type : "select" ,
106+ options : [
107+ { id : "low" , label : "Low" } ,
108+ { id : "medium" , label : "Medium" , isDefault : true } ,
109+ { id : "high" , label : "High" } ,
110+ ] ,
111+ currentValue : "medium" ,
112+ } ,
113+ ] ,
114+ } ;
115+
116+ it ( "omits an unselected OpenCode variant even when the catalog has a default" , ( ) => {
117+ const reported : ModelSelection = {
118+ ...selection ,
119+ options : [ { id : "variant" , value : "high" } ] ,
120+ } ;
121+ for ( const report of [
122+ undefined ,
123+ { ...reported , model : "other-model" } ,
124+ { ...reported , instanceId : ProviderInstanceId . make ( "other-provider" ) } ,
125+ ] ) {
126+ expect ( summary ( openCodeCapabilities , selection , report , "opencode" ) ) . toEqual ( {
127+ reasoningLabel : undefined ,
128+ speedLabel : undefined ,
129+ } ) ;
130+ }
131+ } ) ;
132+
133+ it ( "preserves explicit and matching reported OpenCode variant labels" , ( ) => {
134+ const reported : ModelSelection = {
135+ ...selection ,
136+ options : [ { id : "variant" , value : "low" } ] ,
137+ } ;
138+ expect ( summary ( openCodeCapabilities , selection , reported , "opencode" ) . reasoningLabel ) . toBe (
139+ "Low" ,
140+ ) ;
141+ expect (
142+ summary (
143+ openCodeCapabilities ,
144+ { ...selection , options : [ { id : "variant" , value : "high" } ] } ,
145+ reported ,
146+ "opencode" ,
147+ ) . reasoningLabel ,
148+ ) . toBe ( "High" ) ;
149+ expect (
150+ summary (
151+ openCodeCapabilities ,
152+ selection ,
153+ { ...selection , options : [ { id : "variant" , value : "default" } ] } ,
154+ "opencode" ,
155+ ) . reasoningLabel ,
156+ ) . toBe ( "Default" ) ;
157+ } ) ;
158+
100159 it ( "shows a selected reasoning label and Codex fast tier" , ( ) => {
101160 expect (
102161 summary ( CODEX_CAPABILITIES , {
0 commit comments