@@ -22,7 +22,6 @@ import {
2222 scopedSettingsAreMixed ,
2323 scopedSettingsSource ,
2424 selectScopedSettingsEnvironments ,
25- type ScopedSettingsPatch ,
2625} from "./scopedSettings" ;
2726import { resolveSettingsScope } from "./settingsScope" ;
2827
@@ -787,35 +786,37 @@ describe("model selection patches at project scope", () => {
787786 } ,
788787 } ) ;
789788
790- it ( "replaces old options and keeps omitted model identity fields " , ( ) => {
789+ it ( "replaces old options when changing model selections " , ( ) => {
791790 const plan = planScopedSettingsPatch ( checkout , [ customized ] , {
792791 defaultModelSelection : { instanceId : claude , model : "claude-opus-4-8" } ,
793- sourceControlWriterModelSelection : { model : "gpt-5.6-mini" } ,
794- reviewGuideModelSelection : { instanceId : codex } ,
792+ sourceControlWriterModelSelection : { instanceId : codex , model : "gpt-5.6-mini" } ,
793+ reviewGuideModelSelection : { instanceId : codex , model : "gpt-5.6-mini" } ,
795794 textGenerationModelSelection : { instanceId : claude , model : "claude-sonnet-4-6" } ,
796- } as ScopedSettingsPatch ) ;
795+ } ) ;
797796 expect ( plan . serverWrites [ 0 ] ?. patch . projectSettingsOverrides ?. [ projectId ] ) . toEqual ( {
798797 defaultModelSelection : { instanceId : claude , model : "claude-opus-4-8" } ,
799798 sourceControlWriterModelSelection : { instanceId : codex , model : "gpt-5.6-mini" } ,
800- reviewGuideModelSelection : { instanceId : codex , model : "gpt-5.6" } ,
799+ reviewGuideModelSelection : { instanceId : codex , model : "gpt-5.6-mini " } ,
801800 textGenerationModelSelection : { instanceId : claude , model : "claude-sonnet-4-6" } ,
802801 } ) ;
803802 } ) ;
804803
805- it ( "keeps saved model identities when changing only options" , ( ) => {
804+ it ( "completes partial text-generation selections without retaining old options" , ( ) => {
805+ const modelPlan = planScopedSettingsPatch ( checkout , [ customized ] , {
806+ textGenerationModelSelection : { model : "gpt-5.6-mini" } ,
807+ } ) ;
808+ expect (
809+ modelPlan . serverWrites [ 0 ] ?. patch . projectSettingsOverrides ?. [ projectId ]
810+ ?. textGenerationModelSelection ,
811+ ) . toEqual ( { instanceId : codex , model : "gpt-5.6-mini" } ) ;
812+
806813 const options = [ { id : "reasoningEffort" , value : "low" } ] ;
807- // Exercise partial selections before the planner completes them for the wire.
808- const plan = planScopedSettingsPatch ( checkout , [ customized ] , {
809- defaultModelSelection : { options } ,
810- sourceControlWriterModelSelection : { options } ,
811- reviewGuideModelSelection : { options } ,
814+ const optionsPlan = planScopedSettingsPatch ( checkout , [ customized ] , {
812815 textGenerationModelSelection : { options } ,
813- } as unknown as ScopedSettingsPatch ) ;
814- expect ( plan . serverWrites [ 0 ] ?. patch . projectSettingsOverrides ?. [ projectId ] ) . toEqual ( {
815- defaultModelSelection : { instanceId : codex , model : "gpt-5.6" , options } ,
816- sourceControlWriterModelSelection : { instanceId : codex , model : "gpt-5.6" , options } ,
817- reviewGuideModelSelection : { instanceId : codex , model : "gpt-5.6" , options } ,
818- textGenerationModelSelection : { instanceId : codex , model : "gpt-5.6" , options } ,
819816 } ) ;
817+ expect (
818+ optionsPlan . serverWrites [ 0 ] ?. patch . projectSettingsOverrides ?. [ projectId ]
819+ ?. textGenerationModelSelection ,
820+ ) . toEqual ( { ...saved , options } ) ;
820821 } ) ;
821822} ) ;
0 commit comments