@@ -23,7 +23,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace
23
23
import { IChatAgentCommand , IChatAgentData , IChatAgentRequest , IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents' ;
24
24
import { CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatContextKeys' ;
25
25
import { ChatModel , ChatModelInitState , ChatRequestModel , ChatWelcomeMessageModel , IChatModel , ISerializableChatData , ISerializableChatsData } from 'vs/workbench/contrib/chat/common/chatModel' ;
26
- import { ChatRequestAgentPart , ChatRequestAgentSubcommandPart , ChatRequestSlashCommandPart } from 'vs/workbench/contrib/chat/common/chatParserTypes' ;
26
+ import { ChatRequestAgentPart , ChatRequestAgentSubcommandPart , ChatRequestSlashCommandPart , IParsedChatRequest } from 'vs/workbench/contrib/chat/common/chatParserTypes' ;
27
27
import { ChatMessageRole , IChatMessage } from 'vs/workbench/contrib/chat/common/chatProvider' ;
28
28
import { ChatRequestParser } from 'vs/workbench/contrib/chat/common/chatRequestParser' ;
29
29
import { IChat , IChatCompleteResponse , IChatDetail , IChatDynamicRequest , IChatFollowup , IChatProgress , IChatProvider , IChatProviderInfo , IChatResponse , IChatService , IChatTransferredSessionData , IChatUserActionEvent , InteractiveSessionCopyKind , InteractiveSessionVoteDirection } from 'vs/workbench/contrib/chat/common/chatService' ;
@@ -633,7 +633,7 @@ export class ChatService extends Disposable implements IChatService {
633
633
return Array . from ( this . _providers . keys ( ) ) ;
634
634
}
635
635
636
- async addCompleteRequest ( sessionId : string , message : string , response : IChatCompleteResponse ) : Promise < void > {
636
+ async addCompleteRequest ( sessionId : string , message : IParsedChatRequest | string , response : IChatCompleteResponse ) : Promise < void > {
637
637
this . trace ( 'addCompleteRequest' , `message: ${ message } ` ) ;
638
638
639
639
const model = this . _sessionModels . get ( sessionId ) ;
@@ -642,7 +642,9 @@ export class ChatService extends Disposable implements IChatService {
642
642
}
643
643
644
644
await model . waitForInitialization ( ) ;
645
- const parsedRequest = await this . instantiationService . createInstance ( ChatRequestParser ) . parseChatRequest ( sessionId , message ) ;
645
+ const parsedRequest = typeof message === 'string' ?
646
+ await this . instantiationService . createInstance ( ChatRequestParser ) . parseChatRequest ( sessionId , message ) :
647
+ message ;
646
648
const request = model . addRequest ( parsedRequest ) ;
647
649
if ( typeof response . message === 'string' ) {
648
650
model . acceptResponseProgress ( request , { content : response . message , kind : 'content' } ) ;
0 commit comments