File tree Expand file tree Collapse file tree 7 files changed +27
-1
lines changed Expand file tree Collapse file tree 7 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -2943,6 +2943,7 @@ export namespace ChatAgentRequest {
2943
2943
tools,
2944
2944
model,
2945
2945
editedFileEvents : request . editedFileEvents ,
2946
+ modeInstructions : request . modeInstructions ,
2946
2947
} ;
2947
2948
2948
2949
if ( ! isProposedApiEnabled ( extension , 'chatParticipantPrivate' ) ) {
Original file line number Diff line number Diff line change @@ -1333,6 +1333,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
1333
1333
attachedContext : requestInputs . attachedContext ,
1334
1334
noCommandDetection : options ?. noCommandDetection ,
1335
1335
userSelectedTools : this . getUserSelectedTools ( ) ,
1336
+ modeInstructions : this . input . currentMode2 . body
1336
1337
} ) ;
1337
1338
1338
1339
if ( result ) {
@@ -1371,6 +1372,14 @@ export class ChatWidget extends Disposable implements IChatWidget {
1371
1372
return undefined ;
1372
1373
}
1373
1374
1375
+ getModeRequestOptions ( ) : Partial < IChatSendRequestOptions > {
1376
+ return {
1377
+ modeInstructions : this . input . currentMode2 . body ,
1378
+ userSelectedTools : this . getUserSelectedTools ( ) ,
1379
+ mode : this . input . currentMode ,
1380
+ } ;
1381
+ }
1382
+
1374
1383
getCodeBlockInfosForResponse ( response : IChatResponseViewModel ) : IChatCodeBlockInfo [ ] {
1375
1384
return this . renderer . getCodeBlockInfosForResponse ( response ) ;
1376
1385
}
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ export interface IChatAgentRequest {
137
137
rejectedConfirmationData ?: any [ ] ;
138
138
userSelectedModelId ?: string ;
139
139
userSelectedTools ?: Record < string , boolean > ;
140
+ modeInstructions ?: string ;
140
141
toolSelectionIsExclusive ?: boolean ;
141
142
editedFileEvents ?: IChatAgentEditedFileEvent [ ] ;
142
143
}
Original file line number Diff line number Diff line change @@ -62,12 +62,16 @@ export class ChatModeService implements IChatModeService {
62
62
}
63
63
}
64
64
65
+ /**
66
+ * TODO This data object is not quite the right pattern, needs to live-update on file changes
67
+ */
65
68
export interface IChatMode {
66
69
readonly id : string ;
67
70
readonly name : string ;
68
71
readonly description ?: string ;
69
72
readonly kind : ChatMode ;
70
73
readonly customTools ?: readonly string [ ] ;
74
+ readonly body ?: string ;
71
75
}
72
76
73
77
export function isIChatMode ( mode : unknown ) : mode is IChatMode {
@@ -97,6 +101,10 @@ export class CustomChatMode implements IChatMode {
97
101
return this . customChatMode . tools ;
98
102
}
99
103
104
+ get body ( ) : string {
105
+ return this . customChatMode . body ;
106
+ }
107
+
100
108
public readonly kind = ChatMode . Agent ;
101
109
102
110
constructor (
@@ -112,7 +120,8 @@ export class CustomChatMode implements IChatMode {
112
120
name : this . name ,
113
121
description : this . description ,
114
122
kind : this . kind ,
115
- customTools : this . customTools
123
+ customTools : this . customTools ,
124
+ body : this . body
116
125
} ;
117
126
}
118
127
}
Original file line number Diff line number Diff line change @@ -488,6 +488,7 @@ export interface IChatSendRequestOptions {
488
488
mode ?: ChatMode ;
489
489
userSelectedModelId ?: string ;
490
490
userSelectedTools ?: Record < string , boolean > ;
491
+ modeInstructions ?: string ;
491
492
toolSelectionIsExclusive ?: boolean ;
492
493
location ?: ChatAgentLocation ;
493
494
locationData ?: IChatLocationData ;
Original file line number Diff line number Diff line change @@ -763,6 +763,7 @@ export class ChatService extends Disposable implements IChatService {
763
763
rejectedConfirmationData : options ?. rejectedConfirmationData ,
764
764
userSelectedModelId : options ?. userSelectedModelId ,
765
765
userSelectedTools : options ?. userSelectedTools ,
766
+ modeInstructions : options ?. modeInstructions ,
766
767
toolSelectionIsExclusive : options ?. toolSelectionIsExclusive ,
767
768
editedFileEvents : request . editedFileEvents
768
769
} satisfies IChatAgentRequest ;
Original file line number Diff line number Diff line change @@ -446,4 +446,8 @@ declare module 'vscode' {
446
446
export interface LanguageModelToolInvocationOptions < T > {
447
447
model ?: LanguageModelChat ;
448
448
}
449
+
450
+ export interface ChatRequest {
451
+ modeInstructions ?: string ;
452
+ }
449
453
}
You can’t perform that action at this time.
0 commit comments