@@ -10,6 +10,8 @@ import { IInstantiationService } from '../../../../../platform/instantiation/com
10
10
import { IChatProgressRenderableResponseContent } from '../../common/chatModel.js' ;
11
11
import { IChatConfirmation , IChatSendRequestOptions , IChatService } from '../../common/chatService.js' ;
12
12
import { isResponseVM } from '../../common/chatViewModel.js' ;
13
+ import { ChatMode } from '../../common/constants.js' ;
14
+ import { ILanguageModelToolsService } from '../../common/languageModelToolsService.js' ;
13
15
import { IChatWidgetService } from '../chat.js' ;
14
16
import { ChatConfirmationWidget } from './chatConfirmationWidget.js' ;
15
17
import { IChatContentPart , IChatContentPartRenderContext } from './chatContentParts.js' ;
@@ -26,6 +28,7 @@ export class ChatConfirmationContentPart extends Disposable implements IChatCont
26
28
@IInstantiationService private readonly instantiationService : IInstantiationService ,
27
29
@IChatService private readonly chatService : IChatService ,
28
30
@IChatWidgetService chatWidgetService : IChatWidgetService ,
31
+ @ILanguageModelToolsService private readonly toolsService : ILanguageModelToolsService ,
29
32
) {
30
33
super ( ) ;
31
34
@@ -56,6 +59,15 @@ export class ChatConfirmationContentPart extends Disposable implements IChatCont
56
59
const widget = chatWidgetService . getWidgetBySessionId ( element . sessionId ) ;
57
60
options . userSelectedModelId = widget ?. input . currentLanguageModel ;
58
61
options . mode = widget ?. input . currentMode ;
62
+ if ( widget ?. input . currentMode2 . customTools ) {
63
+ options . userSelectedTools = this . toolsService . toEnablementMap ( widget . input . currentMode2 . customTools ) ;
64
+ } else if ( widget ?. input . currentMode === ChatMode . Agent ) {
65
+ options . userSelectedTools = { } ;
66
+ for ( const [ tool , enablement ] of widget . input . selectedToolsModel . asEnablementMap ( ) ) {
67
+ options . userSelectedTools [ tool . id ] = enablement ;
68
+ }
69
+ }
70
+
59
71
if ( await this . chatService . sendRequest ( element . sessionId , prompt , options ) ) {
60
72
confirmation . isUsed = true ;
61
73
confirmationWidget . setShowButtons ( false ) ;
0 commit comments