@@ -1051,15 +1051,15 @@ describe('Settings Loading and Merging', () => {
10511051 } ) ;
10521052 } ) ;
10531053
1054- it ( 'should merge chatCompression settings, with workspace taking precedence' , ( ) => {
1054+ it ( 'should merge compressionThreshold settings, with workspace taking precedence' , ( ) => {
10551055 ( mockFsExistsSync as Mock ) . mockReturnValue ( true ) ;
10561056 const userSettingsContent = {
10571057 general : { } ,
1058- model : { chatCompression : { contextPercentageThreshold : 0.5 } } ,
1058+ model : { compressionThreshold : 0.5 } ,
10591059 } ;
10601060 const workspaceSettingsContent = {
10611061 general : { } ,
1062- model : { chatCompression : { contextPercentageThreshold : 0.8 } } ,
1062+ model : { compressionThreshold : 0.8 } ,
10631063 } ;
10641064
10651065 ( fs . readFileSync as Mock ) . mockImplementation (
@@ -1074,15 +1074,11 @@ describe('Settings Loading and Merging', () => {
10741074
10751075 const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
10761076
1077- expect ( settings . user . settings . model ?. chatCompression ) . toEqual ( {
1078- contextPercentageThreshold : 0.5 ,
1079- } ) ;
1080- expect ( settings . workspace . settings . model ?. chatCompression ) . toEqual ( {
1081- contextPercentageThreshold : 0.8 ,
1082- } ) ;
1083- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1084- contextPercentageThreshold : 0.8 ,
1085- } ) ;
1077+ expect ( settings . user . settings . model ?. compressionThreshold ) . toEqual ( 0.5 ) ;
1078+ expect ( settings . workspace . settings . model ?. compressionThreshold ) . toEqual (
1079+ 0.8 ,
1080+ ) ;
1081+ expect ( settings . merged . model ?. compressionThreshold ) . toEqual ( 0.8 ) ;
10861082 } ) ;
10871083
10881084 it ( 'should merge output format settings, with workspace taking precedence' , ( ) => {
@@ -1109,13 +1105,13 @@ describe('Settings Loading and Merging', () => {
11091105 expect ( settings . merged . output ?. format ) . toBe ( 'json' ) ;
11101106 } ) ;
11111107
1112- it ( 'should handle chatCompression when only in user settings' , ( ) => {
1108+ it ( 'should handle compressionThreshold when only in user settings' , ( ) => {
11131109 ( mockFsExistsSync as Mock ) . mockImplementation (
11141110 ( p : fs . PathLike ) => p === USER_SETTINGS_PATH ,
11151111 ) ;
11161112 const userSettingsContent = {
11171113 general : { } ,
1118- model : { chatCompression : { contextPercentageThreshold : 0.5 } } ,
1114+ model : { compressionThreshold : 0.5 } ,
11191115 } ;
11201116 ( fs . readFileSync as Mock ) . mockImplementation (
11211117 ( p : fs . PathOrFileDescriptor ) => {
@@ -1126,9 +1122,7 @@ describe('Settings Loading and Merging', () => {
11261122 ) ;
11271123
11281124 const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
1129- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1130- contextPercentageThreshold : 0.5 ,
1131- } ) ;
1125+ expect ( settings . merged . model ?. compressionThreshold ) . toEqual ( 0.5 ) ;
11321126 } ) ;
11331127
11341128 it ( 'should have model as undefined if not in any settings file' , ( ) => {
@@ -1138,39 +1132,15 @@ describe('Settings Loading and Merging', () => {
11381132 expect ( settings . merged . model ) . toBeUndefined ( ) ;
11391133 } ) ;
11401134
1141- it ( 'should ignore chatCompression if contextPercentageThreshold is invalid' , ( ) => {
1142- const warnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
1143- ( mockFsExistsSync as Mock ) . mockImplementation (
1144- ( p : fs . PathLike ) => p === USER_SETTINGS_PATH ,
1145- ) ;
1146- const userSettingsContent = {
1147- general : { } ,
1148- model : { chatCompression : { contextPercentageThreshold : 1.5 } } ,
1149- } ;
1150- ( fs . readFileSync as Mock ) . mockImplementation (
1151- ( p : fs . PathOrFileDescriptor ) => {
1152- if ( p === USER_SETTINGS_PATH )
1153- return JSON . stringify ( userSettingsContent ) ;
1154- return '{}' ;
1155- } ,
1156- ) ;
1157-
1158- const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
1159- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1160- contextPercentageThreshold : 1.5 ,
1161- } ) ;
1162- warnSpy . mockRestore ( ) ;
1163- } ) ;
1164-
1165- it ( 'should deep merge chatCompression settings' , ( ) => {
1135+ it ( 'should use user compressionThreshold if workspace does not define it' , ( ) => {
11661136 ( mockFsExistsSync as Mock ) . mockReturnValue ( true ) ;
11671137 const userSettingsContent = {
11681138 general : { } ,
1169- model : { chatCompression : { contextPercentageThreshold : 0.5 } } ,
1139+ model : { compressionThreshold : 0.5 } ,
11701140 } ;
11711141 const workspaceSettingsContent = {
11721142 general : { } ,
1173- model : { chatCompression : { } } ,
1143+ model : { } ,
11741144 } ;
11751145
11761146 ( fs . readFileSync as Mock ) . mockImplementation (
@@ -1185,9 +1155,7 @@ describe('Settings Loading and Merging', () => {
11851155
11861156 const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
11871157
1188- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1189- contextPercentageThreshold : 0.5 ,
1190- } ) ;
1158+ expect ( settings . merged . model ?. compressionThreshold ) . toEqual ( 0.5 ) ;
11911159 } ) ;
11921160
11931161 it ( 'should merge includeDirectories from all scopes' , ( ) => {
@@ -1972,9 +1940,6 @@ describe('Settings Loading and Merging', () => {
19721940 } ,
19731941 model : {
19741942 name : 'gemini-pro' ,
1975- chatCompression : {
1976- contextPercentageThreshold : 0.5 ,
1977- } ,
19781943 } ,
19791944 mcpServers : {
19801945 'server-1' : {
@@ -1993,9 +1958,6 @@ describe('Settings Loading and Merging', () => {
19931958 myTheme : { } ,
19941959 } ,
19951960 model : 'gemini-pro' ,
1996- chatCompression : {
1997- contextPercentageThreshold : 0.5 ,
1998- } ,
19991961 mcpServers : {
20001962 'server-1' : {
20011963 command : 'node server.js' ,
@@ -2035,9 +1997,6 @@ describe('Settings Loading and Merging', () => {
20351997 } ,
20361998 model : {
20371999 name : 'gemini-pro' ,
2038- chatCompression : {
2039- contextPercentageThreshold : 0.8 ,
2040- } ,
20412000 } ,
20422001 context : {
20432002 fileName : 'CONTEXT.md' ,
@@ -2077,9 +2036,6 @@ describe('Settings Loading and Merging', () => {
20772036 theme : 'dark' ,
20782037 usageStatisticsEnabled : false ,
20792038 model : 'gemini-pro' ,
2080- chatCompression : {
2081- contextPercentageThreshold : 0.8 ,
2082- } ,
20832039 contextFileName : 'CONTEXT.md' ,
20842040 includeDirectories : [ '/src' ] ,
20852041 sandbox : true ,
0 commit comments