File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/core/src/codewhispererChat/storages Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,9 @@ export class ChatHistoryManager {
8080 * Push an assistant message to the history
8181 */
8282 public pushAssistantMessage ( newMessage : ChatMessage ) : void {
83- if ( newMessage !== undefined && this . lastUserMessage !== undefined ) {
84- this . logger . warn ( 'last Message should not be defined when pushing an assistant message' )
83+ if ( newMessage !== undefined && this . lastUserMessage === undefined ) {
84+ this . logger . warn ( 'Assistant response should always come after user input message' )
85+ return
8586 }
8687 // check if last message in histroy is assistant message and now replace it in that case
8788 if ( this . history . length > 0 && this . history . at ( - 1 ) ?. assistantResponseMessage ) {
You can’t perform that action at this time.
0 commit comments