610
611
for (const part of parts) {
612
>
let segment: { text: string; isBlock?: boolean } | undefined;
chatModel.ts
613
>
switch (part.kind) {
614
>
case 'clearToPreviousToolInvocation':
615
currentBlockSegments = [];
616
blocks.length = 0;
617
hasEditGroupsAfterLastClear = false; // Reset edit groups flag when clearing
618
continue;
620
>
case 'progressMessage':
621
>
case 'codeblockUri':
622
>
case 'extensions':
623
>
case 'pullRequest':
624
>
case 'undoStop':
625
>
case 'workspaceEdit':
626
>
case 'externalEdit':
627
>
case 'elicitation2':
628
>
case 'elicitationSerialized':
629
>
case 'thinking':
630
>
case 'hook':
631
>
case 'multiDiffData':
632
>
case 'mcpServersStarting':
633
>
case 'mcpAuthenticationRequired':
634
>
case 'mcpServersStartingSlow':
635
>
case 'questionCarousel':
636
>
case 'planReview':
637
>
case 'disabledClaudeHooks':
638
>
case 'autoModeResolution':
639
// Ignore
640
continue;
642
segment = { text: part.content.value, isBlock: true };
643
break;
645
>
case 'toolInvocationSerialized':
646
// Include tool invocations in the copy text
647
segment = this.getToolInvocationText(part);
648
break;
650
segment = { text: this.inlineRefToRepr(part) };
651
break;
653
segment = { text: part.command.title, isBlock: true };
654
break;
656
>
case 'notebookEditGroup':
657
// Mark that we have edit groups after the last clear
658
hasEditGroupsAfterLastClear = true;
659
// Skip individual edit groups to avoid duplication
660
continue;
662
if (part.message instanceof MarkdownString) {
663
segment = { text: `${part.title}\n${part.message.value}`, isBlock: true };