@@ -1057,7 +1057,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
10571057 ! lastPart ||
10581058 lastPart . kind === 'references' ||
10591059 ( lastPart . kind === 'markdownContent' && ! moreContentAvailable && this . hasBeenCaughtUpLongEnough ( element ) ) ||
1060- ( ( lastPart . kind === 'toolInvocation' || lastPart . kind === 'toolInvocationSerialized' ) && ( IChatToolInvocation . isComplete ( lastPart ) || lastPart . presentation === 'hidden' ) ) ||
1060+ ( ( lastPart . kind === 'toolInvocation' || lastPart . kind === 'toolInvocationSerialized' ) && ( IChatToolInvocation . isComplete ( lastPart ) || IChatToolInvocation . isEffectivelyHidden ( lastPart ) ) ) ||
10611061 ( ( lastPart . kind === 'textEditGroup' || lastPart . kind === 'notebookEditGroup' ) && lastPart . done && ! partsToRender . some ( part => part . kind === 'toolInvocation' && ! IChatToolInvocation . isComplete ( part ) ) ) ||
10621062 ( lastPart . kind === 'progressTask' && lastPart . deferred . isSettled ) ||
10631063 lastPart . kind === 'mcpServersStarting' ||
@@ -1969,7 +1969,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
19691969 const lastThinking = this . getLastThinkingPart ( templateData . renderedParts ) ;
19701970
19711971 // create thinking part if it doesn't exist yet
1972- if ( ! lastThinking && toolInvocation . presentation !== 'hidden' && this . shouldPinPart ( toolInvocation , context . element ) && collapsedToolsMode === CollapsedToolsDisplayMode . Always ) {
1972+ if ( ! lastThinking && ! IChatToolInvocation . isEffectivelyHidden ( toolInvocation ) && this . shouldPinPart ( toolInvocation , context . element ) && collapsedToolsMode === CollapsedToolsDisplayMode . Always ) {
19731973 const thinkingPart = this . renderThinkingPart ( {
19741974 kind : 'thinking' ,
19751975 } , context , templateData ) ;
@@ -1985,7 +1985,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
19851985 }
19861986
19871987 if ( this . shouldPinPart ( toolInvocation , context . element ) ) {
1988- if ( lastThinking && toolInvocation . presentation !== 'hidden' ) {
1988+ if ( lastThinking && ! IChatToolInvocation . isEffectivelyHidden ( toolInvocation ) ) {
19891989 // Append using factory - thinking part decides whether to render lazily
19901990 toolInvocation . isAttachedToThinking = true ;
19911991 lastThinking . appendItem ( createToolPart , toolInvocation . toolId , toolInvocation , templateData . value ) ;
@@ -2001,7 +2001,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
20012001
20022002 // Check for subagent grouping before creating tool part - subagent part handles lazy creation
20032003 const subagentId = getSubagentId ( toolInvocation ) ;
2004- if ( subagentId && isResponseVM ( context . element ) && toolInvocation . presentation !== 'hidden' ) {
2004+ if ( subagentId && isResponseVM ( context . element ) && ! IChatToolInvocation . isEffectivelyHidden ( toolInvocation ) ) {
20052005 return this . handleSubagentToolGrouping ( toolInvocation , subagentId , context , templateData , codeBlockStartIndex ) ;
20062006 }
20072007
@@ -2143,6 +2143,8 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
21432143 return ;
21442144 }
21452145
2146+ this . finalizeCurrentThinkingPart ( context , templateData ) ;
2147+
21462148 const taskPart = this . instantiationService . createInstance ( ChatTaskContentPart , task , this . _contentReferencesListPool , this . chatContentMarkdownRenderer , context ) ;
21472149 return taskPart ;
21482150 }
0 commit comments