@@ -1104,15 +1104,15 @@ describe('Settings Loading and Merging', () => {
11041104 } ) ;
11051105 } ) ;
11061106
1107- it ( 'should merge chatCompression settings, with workspace taking precedence' , ( ) => {
1107+ it ( 'should merge compressionThreshold settings, with workspace taking precedence' , ( ) => {
11081108 ( mockFsExistsSync as Mock ) . mockReturnValue ( true ) ;
11091109 const userSettingsContent = {
11101110 general : { } ,
1111- model : { chatCompression : { contextPercentageThreshold : 0.5 } } ,
1111+ model : { compressionThreshold : 0.5 } ,
11121112 } ;
11131113 const workspaceSettingsContent = {
11141114 general : { } ,
1115- model : { chatCompression : { contextPercentageThreshold : 0.8 } } ,
1115+ model : { compressionThreshold : 0.8 } ,
11161116 } ;
11171117
11181118 ( fs . readFileSync as Mock ) . mockImplementation (
@@ -1127,15 +1127,11 @@ describe('Settings Loading and Merging', () => {
11271127
11281128 const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
11291129
1130- expect ( settings . user . settings . model ?. chatCompression ) . toEqual ( {
1131- contextPercentageThreshold : 0.5 ,
1132- } ) ;
1133- expect ( settings . workspace . settings . model ?. chatCompression ) . toEqual ( {
1134- contextPercentageThreshold : 0.8 ,
1135- } ) ;
1136- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1137- contextPercentageThreshold : 0.8 ,
1138- } ) ;
1130+ expect ( settings . user . settings . model ?. compressionThreshold ) . toEqual ( 0.5 ) ;
1131+ expect ( settings . workspace . settings . model ?. compressionThreshold ) . toEqual (
1132+ 0.8 ,
1133+ ) ;
1134+ expect ( settings . merged . model ?. compressionThreshold ) . toEqual ( 0.8 ) ;
11391135 } ) ;
11401136
11411137 it ( 'should merge output format settings, with workspace taking precedence' , ( ) => {
@@ -1162,13 +1158,13 @@ describe('Settings Loading and Merging', () => {
11621158 expect ( settings . merged . output ?. format ) . toBe ( 'json' ) ;
11631159 } ) ;
11641160
1165- it ( 'should handle chatCompression when only in user settings' , ( ) => {
1161+ it ( 'should handle compressionThreshold when only in user settings' , ( ) => {
11661162 ( mockFsExistsSync as Mock ) . mockImplementation (
11671163 ( p : fs . PathLike ) => p === USER_SETTINGS_PATH ,
11681164 ) ;
11691165 const userSettingsContent = {
11701166 general : { } ,
1171- model : { chatCompression : { contextPercentageThreshold : 0.5 } } ,
1167+ model : { compressionThreshold : 0.5 } ,
11721168 } ;
11731169 ( fs . readFileSync as Mock ) . mockImplementation (
11741170 ( p : fs . PathOrFileDescriptor ) => {
@@ -1179,9 +1175,7 @@ describe('Settings Loading and Merging', () => {
11791175 ) ;
11801176
11811177 const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
1182- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1183- contextPercentageThreshold : 0.5 ,
1184- } ) ;
1178+ expect ( settings . merged . model ?. compressionThreshold ) . toEqual ( 0.5 ) ;
11851179 } ) ;
11861180
11871181 it ( 'should have model as undefined if not in any settings file' , ( ) => {
@@ -1191,39 +1185,15 @@ describe('Settings Loading and Merging', () => {
11911185 expect ( settings . merged . model ) . toBeUndefined ( ) ;
11921186 } ) ;
11931187
1194- it ( 'should ignore chatCompression if contextPercentageThreshold is invalid' , ( ) => {
1195- const warnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
1196- ( mockFsExistsSync as Mock ) . mockImplementation (
1197- ( p : fs . PathLike ) => p === USER_SETTINGS_PATH ,
1198- ) ;
1199- const userSettingsContent = {
1200- general : { } ,
1201- model : { chatCompression : { contextPercentageThreshold : 1.5 } } ,
1202- } ;
1203- ( fs . readFileSync as Mock ) . mockImplementation (
1204- ( p : fs . PathOrFileDescriptor ) => {
1205- if ( p === USER_SETTINGS_PATH )
1206- return JSON . stringify ( userSettingsContent ) ;
1207- return '{}' ;
1208- } ,
1209- ) ;
1210-
1211- const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
1212- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1213- contextPercentageThreshold : 1.5 ,
1214- } ) ;
1215- warnSpy . mockRestore ( ) ;
1216- } ) ;
1217-
1218- it ( 'should deep merge chatCompression settings' , ( ) => {
1188+ it ( 'should use user compressionThreshold if workspace does not define it' , ( ) => {
12191189 ( mockFsExistsSync as Mock ) . mockReturnValue ( true ) ;
12201190 const userSettingsContent = {
12211191 general : { } ,
1222- model : { chatCompression : { contextPercentageThreshold : 0.5 } } ,
1192+ model : { compressionThreshold : 0.5 } ,
12231193 } ;
12241194 const workspaceSettingsContent = {
12251195 general : { } ,
1226- model : { chatCompression : { } } ,
1196+ model : { } ,
12271197 } ;
12281198
12291199 ( fs . readFileSync as Mock ) . mockImplementation (
@@ -1238,9 +1208,7 @@ describe('Settings Loading and Merging', () => {
12381208
12391209 const settings = loadSettings ( MOCK_WORKSPACE_DIR ) ;
12401210
1241- expect ( settings . merged . model ?. chatCompression ) . toEqual ( {
1242- contextPercentageThreshold : 0.5 ,
1243- } ) ;
1211+ expect ( settings . merged . model ?. compressionThreshold ) . toEqual ( 0.5 ) ;
12441212 } ) ;
12451213
12461214 it ( 'should merge includeDirectories from all scopes' , ( ) => {
@@ -2025,9 +1993,6 @@ describe('Settings Loading and Merging', () => {
20251993 } ,
20261994 model : {
20271995 name : 'gemini-pro' ,
2028- chatCompression : {
2029- contextPercentageThreshold : 0.5 ,
2030- } ,
20311996 } ,
20321997 mcpServers : {
20331998 'server-1' : {
@@ -2046,9 +2011,6 @@ describe('Settings Loading and Merging', () => {
20462011 myTheme : { } ,
20472012 } ,
20482013 model : 'gemini-pro' ,
2049- chatCompression : {
2050- contextPercentageThreshold : 0.5 ,
2051- } ,
20522014 mcpServers : {
20532015 'server-1' : {
20542016 command : 'node server.js' ,
@@ -2088,9 +2050,6 @@ describe('Settings Loading and Merging', () => {
20882050 } ,
20892051 model : {
20902052 name : 'gemini-pro' ,
2091- chatCompression : {
2092- contextPercentageThreshold : 0.8 ,
2093- } ,
20942053 } ,
20952054 context : {
20962055 fileName : 'CONTEXT.md' ,
@@ -2130,9 +2089,6 @@ describe('Settings Loading and Merging', () => {
21302089 theme : 'dark' ,
21312090 usageStatisticsEnabled : false ,
21322091 model : 'gemini-pro' ,
2133- chatCompression : {
2134- contextPercentageThreshold : 0.8 ,
2135- } ,
21362092 contextFileName : 'CONTEXT.md' ,
21372093 includeDirectories : [ '/src' ] ,
21382094 sandbox : true ,
0 commit comments