@@ -248,6 +248,51 @@ describe("Codex agent harness supports()", () => {
248248 expect ( ! result . supported ? result . reason : undefined ) . toContain ( "not declared" ) ;
249249 } ) ;
250250
251+ it ( "lets explicitly selected Codex discover unlisted models with its own account" , ( ) => {
252+ expect (
253+ harness . supports ( {
254+ provider : "openai" ,
255+ modelId : "gpt-future" ,
256+ requestedRuntime : "codex" ,
257+ modelProvider : {
258+ requestTransportOverrides : "none" ,
259+ preparedAuth : { source : "harness" } ,
260+ } ,
261+ } ) ,
262+ ) . toEqual ( { supported : true , priority : 100 } ) ;
263+ } ) ;
264+
265+ it . each ( [
266+ {
267+ label : "automatic runtime selection" ,
268+ requestedRuntime : "auto" as const ,
269+ modelProvider : { preparedAuth : { source : "harness" as const } } ,
270+ } ,
271+ {
272+ label : "an authored endpoint" ,
273+ requestedRuntime : "codex" as const ,
274+ modelProvider : {
275+ baseUrl : "https://relay.example.test/v1" ,
276+ preparedAuth : { source : "harness" as const } ,
277+ } ,
278+ } ,
279+ {
280+ label : "an owner-selected credential" ,
281+ requestedRuntime : "codex" as const ,
282+ modelProvider : { preparedAuth : { source : "profile" as const , mode : "api-key" } } ,
283+ } ,
284+ ] ) ( "does not infer native model access for $label" , ( { requestedRuntime, modelProvider } ) => {
285+ const result = harness . supports ( {
286+ provider : "openai" ,
287+ modelId : "gpt-future" ,
288+ requestedRuntime,
289+ modelProvider : { requestTransportOverrides : "none" , ...modelProvider } ,
290+ } ) ;
291+
292+ expect ( result . supported ) . toBe ( false ) ;
293+ expect ( ! result . supported ? result . reason : undefined ) . toContain ( "not declared" ) ;
294+ } ) ;
295+
251296 it . each ( [
252297 {
253298 label : "forwarded OAuth subscription" ,
0 commit comments