@@ -923,6 +923,79 @@ describe("composer fallback to another instance of the same driver", () => {
923923 expect ( traits . modelOptionsForDispatch ) . toBeUndefined ( ) ;
924924 } ) ;
925925
926+ describe ( "with model aliases" , ( ) => {
927+ const reasoningModel = (
928+ slug : string ,
929+ id : string ,
930+ extra : Partial < ServerProvider [ "models" ] [ number ] > = { } ,
931+ ) : ServerProvider [ "models" ] [ number ] => ( {
932+ slug,
933+ name : slug ,
934+ isCustom : false ,
935+ ...extra ,
936+ capabilities : {
937+ optionDescriptors : [
938+ {
939+ id,
940+ label : id ,
941+ type : "select" ,
942+ options : [ "medium" , "high" , "xhigh" ] . map ( ( value ) => ( {
943+ id : value ,
944+ label : value ,
945+ isDefault : value === "medium" ,
946+ } ) ) ,
947+ } ,
948+ ] ,
949+ } ,
950+ } ) ;
951+
952+ it ( "keeps the effort of a thread saved under a driver alias" , ( ) => {
953+ const disabledCodex = ProviderInstanceId . make ( "codex" ) ;
954+ const fallbackCodex = ProviderInstanceId . make ( "codex_team" ) ;
955+ const models = [ reasoningModel ( "gpt-5.4" , "reasoningEffort" ) ] ;
956+ const { selectedInstanceId, state, traits } = composerFor ( {
957+ providers : [
958+ { ...provider ( { provider : codex , instanceId : disabledCodex } ) , enabled : false , models } ,
959+ { ...provider ( { provider : codex , instanceId : fallbackCodex } ) , models } ,
960+ ] ,
961+ // "5.4" is the driver alias of gpt-5.4.
962+ threadModelSelection : createModelSelection ( disabledCodex , "5.4" , [
963+ { id : "reasoningEffort" , value : "xhigh" } ,
964+ ] ) ,
965+ } ) ;
966+
967+ expect ( selectedInstanceId ) . toBe ( fallbackCodex ) ;
968+ expect ( state . selectedModel ) . toBe ( "gpt-5.4" ) ;
969+ expect ( traits . promptEffort ) . toBe ( "xhigh" ) ;
970+ } ) ;
971+
972+ it ( "does not carry options through an alias that names another model per instance" , ( ) => {
973+ // "antigravity-default" is each Antigravity instance's current model.
974+ const antigravity = ProviderDriverKind . make ( "antigravity" ) ;
975+ const disabledAntigravity = ProviderInstanceId . make ( "antigravity" ) ;
976+ const current = { isDefault : true , aliases : [ ANTIGRAVITY_DEFAULT_MODEL ] } ;
977+ const { state, traits } = composerFor ( {
978+ providers : [
979+ {
980+ ...provider ( { provider : antigravity , instanceId : disabledAntigravity } ) ,
981+ enabled : false ,
982+ models : [ reasoningModel ( "gemini-3-pro" , "thinking" , current ) ] ,
983+ } ,
984+ {
985+ ...provider ( { provider : antigravity , instanceId : "antigravity_work" } ) ,
986+ models : [ reasoningModel ( "claude-sonnet-4-6" , "thinking" , current ) ] ,
987+ } ,
988+ ] ,
989+ threadModelSelection : createModelSelection ( disabledAntigravity , ANTIGRAVITY_DEFAULT_MODEL , [
990+ { id : "thinking" , value : "high" } ,
991+ ] ) ,
992+ } ) ;
993+
994+ expect ( state . selectedModel ) . toBe ( "claude-sonnet-4-6" ) ;
995+ expect ( traits . modelOptionsForDispatch ) . toBeUndefined ( ) ;
996+ } ) ;
997+ } ) ;
998+
926999 it ( "does not carry options to another driver" , ( ) => {
9271000 const codexOnly : ReadonlyArray < ServerProvider > = [
9281001 {
0 commit comments