Skip to content

Commit c28da72

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 4b14a7c commit c28da72

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';
@@ -1173,7 +1175,9 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
11731175
}
11741176

11751177
private shouldShowFileChangesSummary(element: IChatResponseViewModel): boolean {
1176-
return element.isComplete && this.configService.getValue<boolean>('chat.checkpoints.showFileChanges');
1178+
// Only show file changes summary for local sessions - background sessions already have their own file changes part
1179+
const isLocalSession = getChatSessionType(element.sessionResource) === localChatSessionType;
1180+
return element.isComplete && isLocalSession && this.configService.getValue<boolean>('chat.checkpoints.showFileChanges');
11771181
}
11781182

11791183
private getDataForProgressiveRender(element: IChatResponseViewModel) {

0 commit comments

Comments
 (0)