Skip to content

Commit d3216dd

Browse files
Copilotosortega
andcommitted
Fix duplicated file changes for background sessions
When chat.checkpoints.showFileChanges is enabled, only show file changes summary for local sessions since background sessions already have their own file changes part registered. Co-authored-by: osortega <[email protected]>
1 parent e851e28 commit d3216dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ import { IChatChangesSummaryPart, IChatCodeCitations, IChatErrorDetailsPart, ICh
5959
import { getNWords } from '../common/chatWordCounter.js';
6060
import { CodeBlockModelCollection } from '../common/codeBlockModelCollection.js';
6161
import { ChatAgentLocation, ChatConfiguration, ChatModeKind, CollapsedToolsDisplayMode, ThinkingDisplayMode } from '../common/constants.js';
62+
import { localChatSessionType } from '../common/chatSessionsService.js';
63+
import { getChatSessionType } from '../common/chatUri.js';
6264
import { MarkUnhelpfulActionId } from './actions/chatTitleActions.js';
6365
import { ChatTreeItem, IChatCodeBlockInfo, IChatFileTreeInfo, IChatListItemRendererOptions, IChatWidgetService } from './chat.js';
6466
import { ChatAgentHover, getChatAgentHoverOptions } from './chatAgentHover.js';
@@ -1163,7 +1165,9 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
11631165
}
11641166

11651167
private shouldShowFileChangesSummary(element: IChatResponseViewModel): boolean {
1166-
return element.isComplete && this.configService.getValue<boolean>('chat.checkpoints.showFileChanges');
1168+
// Only show file changes summary for local sessions - background sessions already have their own file changes part
1169+
const isLocalSession = getChatSessionType(element.sessionResource) === localChatSessionType;
1170+
return element.isComplete && isLocalSession && this.configService.getValue<boolean>('chat.checkpoints.showFileChanges');
11671171
}
11681172

11691173
private getDataForProgressiveRender(element: IChatResponseViewModel) {

0 commit comments

Comments
 (0)