File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
src/vs/workbench/contrib/chat/browser Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -404,12 +404,6 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
404
404
} ) ;
405
405
406
406
this . initSelectedModel ( ) ;
407
-
408
- this . _register ( agentService . onDidChangeAgents ( ( ) => {
409
- if ( ! agentService . hasToolsAgent && this . _currentMode === ChatMode . Agent ) {
410
- this . setChatMode ( ChatMode . Edit ) ;
411
- }
412
- } ) ) ;
413
407
}
414
408
415
409
private getSelectedModelStorageKey ( ) : string {
@@ -469,10 +463,6 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
469
463
}
470
464
471
465
mode = validateChatMode ( mode ) ?? ( this . location === ChatAgentLocation . Panel ? ChatMode . Ask : ChatMode . Edit ) ;
472
- if ( mode === ChatMode . Agent && ! this . agentService . hasToolsAgent ) {
473
- mode = ChatMode . Edit ;
474
- }
475
-
476
466
this . _currentMode = mode ;
477
467
this . chatMode . set ( mode ) ;
478
468
this . _onDidChangeCurrentChatMode . fire ( ) ;
@@ -714,6 +704,12 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
714
704
}
715
705
}
716
706
707
+ validateCurrentMode ( ) : void {
708
+ if ( ! this . agentService . hasToolsAgent && this . _currentMode === ChatMode . Agent ) {
709
+ this . setChatMode ( ChatMode . Edit ) ;
710
+ }
711
+ }
712
+
717
713
// A funtion that filters out specifically the `value` property of the attachment.
718
714
private getFilteredEntry ( query : string , inputState : IChatInputState ) : IChatHistoryEntry {
719
715
const attachmentsWithoutImageValues = inputState . chatContextAttachments ?. map ( attachment => {
Original file line number Diff line number Diff line change @@ -1143,6 +1143,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
1143
1143
1144
1144
this . chatService . cancelCurrentRequestForSession ( this . viewModel . sessionId ) ;
1145
1145
1146
+ this . input . validateCurrentMode ( ) ;
1146
1147
const result = await this . chatService . sendRequest ( this . viewModel . sessionId , input , {
1147
1148
mode : this . inputPart . currentMode ,
1148
1149
userSelectedModelId : this . inputPart . currentLanguageModel ,
You can’t perform that action at this time.
0 commit comments