@@ -551,29 +551,23 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
551
551
templateData . rowContainer . classList . toggle ( 'chat-response-loading' , ( isResponseVM ( element ) && ! element . isComplete ) ) ;
552
552
553
553
const content : IChatRendererContent [ ] = [ ] ;
554
- // Always add the references to avoid shifting the content parts when a reference is added, and having to re-diff all the content.
555
- // The part will hide itself if the list is empty.
556
- content . push ( { kind : 'references' , references : element . contentReferences } ) ;
557
- content . push ( ...annotateSpecialMarkdownContent ( element . response . value ) ) ;
558
- if ( element . codeCitations . length ) {
559
- content . push ( { kind : 'codeCitations' , citations : element . codeCitations } ) ;
554
+ const isFiltered = ! ! element . errorDetails ?. responseIsFiltered ;
555
+ if ( ! isFiltered ) {
556
+ // Always add the references to avoid shifting the content parts when a reference is added, and having to re-diff all the content.
557
+ // The part will hide itself if the list is empty.
558
+ content . push ( { kind : 'references' , references : element . contentReferences } ) ;
559
+ content . push ( ...annotateSpecialMarkdownContent ( element . response . value ) ) ;
560
+ if ( element . codeCitations . length ) {
561
+ content . push ( { kind : 'codeCitations' , citations : element . codeCitations } ) ;
562
+ }
560
563
}
561
564
562
565
if ( element . errorDetails ?. message && element . errorDetails . message !== canceledName ) {
563
566
content . push ( { kind : 'errorDetails' , errorDetails : element . errorDetails , isLast : index === this . delegate . getListLength ( ) - 1 } ) ;
564
567
}
565
568
566
- const isFiltered = ! ! element . errorDetails ?. responseIsFiltered ;
567
- if ( ! isFiltered ) {
568
- const diff = this . diff ( templateData . renderedParts ?? [ ] , content , element ) ;
569
- this . renderChatContentDiff ( diff , content , element , index , templateData ) ;
570
- } else {
571
- dom . clearNode ( templateData . value ) ;
572
- if ( templateData . renderedParts ) {
573
- dispose ( templateData . renderedParts ) ;
574
- }
575
- templateData . renderedParts = [ ] ;
576
- }
569
+ const diff = this . diff ( templateData . renderedParts ?? [ ] , content , element ) ;
570
+ this . renderChatContentDiff ( diff , content , element , index , templateData ) ;
577
571
578
572
this . updateItemHeightOnRender ( element , templateData ) ;
579
573
}
@@ -978,7 +972,8 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
978
972
renderedError . addDisposable ( renderedError . onDidChangeHeight ( ( ) => this . updateItemHeight ( templateData ) ) ) ;
979
973
return renderedError ;
980
974
} else if ( content . errorDetails . confirmationButtons && isLast ) {
981
- const errorConfirmation = this . instantiationService . createInstance ( ChatErrorConfirmationContentPart , ChatErrorLevel . Error , new MarkdownString ( content . errorDetails . message ) , content , content . errorDetails . confirmationButtons , this . renderer , context ) ;
975
+ const level = content . errorDetails . level ?? ( content . errorDetails . responseIsFiltered ? ChatErrorLevel . Info : ChatErrorLevel . Error ) ;
976
+ const errorConfirmation = this . instantiationService . createInstance ( ChatErrorConfirmationContentPart , level , new MarkdownString ( content . errorDetails . message ) , content , content . errorDetails . confirmationButtons , this . renderer , context ) ;
982
977
errorConfirmation . addDisposable ( errorConfirmation . onDidChangeHeight ( ( ) => this . updateItemHeight ( templateData ) ) ) ;
983
978
return errorConfirmation ;
984
979
} else {
0 commit comments