@@ -227,6 +227,42 @@ describe("vision eligibility core", () => {
227227 } ) ) . toBe ( false ) ;
228228 } ) ;
229229
230+ test ( "15. native model declared text-only via modelCapabilities is disqualified from vision describer eligibility (#4501)" , ( ) => {
231+ const config = configWithProviders ( {
232+ openai : {
233+ adapter : "openai-responses" ,
234+ baseUrl : "https://chatgpt.com/backend-api/codex" ,
235+ modelCapabilities : {
236+ "gpt-5.4-mini" : { inputModalities : [ "text" ] } ,
237+ } ,
238+ } ,
239+ } ) ;
240+ const candidate : VisionCandidateModel = {
241+ provider : "openai" ,
242+ id : "gpt-5.4-mini" ,
243+ } ;
244+ expect ( modelAcceptsImageInput ( config , candidate ) ) . toBe ( false ) ;
245+ expect ( isVisionEligibleModel ( config , candidate ) ) . toBe ( false ) ;
246+ } ) ;
247+
248+ test ( "16. native model baseline declared text-only via modelCapabilities drops the baseline option (#4501)" , ( ) => {
249+ const config = configWithProviders ( {
250+ openai : {
251+ adapter : "openai-responses" ,
252+ baseUrl : "https://chatgpt.com/backend-api/codex" ,
253+ modelCapabilities : {
254+ [ BASELINE_VISION_MODELS . openai ] : { inputModalities : [ "text" ] } ,
255+ } ,
256+ } ,
257+ anthropic : {
258+ adapter : "anthropic" ,
259+ baseUrl : "https://api.anthropic.com" ,
260+ } ,
261+ } ) ;
262+ const options = visionEligibleModelOptions ( config , [ ] , [ "openai" , "anthropic" ] , "anthropic" ) ;
263+ expect ( options . map ( o => o . value ) ) . toEqual ( [ BASELINE_VISION_MODELS . anthropic ] ) ;
264+ } ) ;
265+
230266 test ( "5. openai baseline is present when that side is enabled" , ( ) => {
231267 const options = visionEligibleModelOptions ( emptyConfig , [ ] , [ "openai" ] ) ;
232268 expect ( options . map ( ( o ) => o . value ) ) . toEqual ( [ BASELINE_VISION_MODELS . openai ] ) ;
0 commit comments