@@ -194,7 +194,7 @@ export class ViewProvider implements vscode.WebviewViewProvider {
194194 if (
195195 event . affectsConfiguration ( 'codeWebChat.contextSizeWarningThreshold' )
196196 ) {
197- this . send_context_size_warning_threshold ( )
197+ this . _send_context_size_warning_threshold ( )
198198 }
199199
200200 const all_api_config_keys = [
@@ -364,6 +364,8 @@ export class ViewProvider implements vscode.WebviewViewProvider {
364364 handle_request_editor_selection_state ( this )
365365 } else if ( message . command == 'GET_CURRENT_TOKEN_COUNT' ) {
366366 this . calculate_token_count ( )
367+ } else if ( message . command == 'GET_CONTEXT_SIZE_WARNING_THRESHOLD' ) {
368+ this . _send_context_size_warning_threshold ( )
367369 } else if ( message . command == 'REPLACE_PRESETS' ) {
368370 await handle_replace_presets ( this , message )
369371 } else if ( message . command == 'UPDATE_PRESET' ) {
@@ -506,7 +508,6 @@ export class ViewProvider implements vscode.WebviewViewProvider {
506508 )
507509
508510 this . send_presets_to_webview ( webview_view . webview )
509- this . send_context_size_warning_threshold ( )
510511 // We need to wait until the webview fully initialized
511512 setTimeout ( ( ) => {
512513 this . send_message ( {
@@ -690,10 +691,10 @@ export class ViewProvider implements vscode.WebviewViewProvider {
690691 } )
691692 }
692693
693- public send_context_size_warning_threshold ( ) {
694+ private _send_context_size_warning_threshold ( ) {
694695 if ( ! this . _webview_view ) return
695696 const config = vscode . workspace . getConfiguration ( 'codeWebChat' )
696- const threshold = config . get < number > ( 'contextSizeWarningThreshold' , 60000 )
697+ const threshold = config . get < number > ( 'contextSizeWarningThreshold' ) !
697698 this . send_message ( {
698699 command : 'CONTEXT_SIZE_WARNING_THRESHOLD' ,
699700 threshold
0 commit comments