Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { $, clearNode } from '../../../../../base/browser/dom.js';
import { IChatThinkingPart } from '../../common/chatService.js';
import { IChatContentPartRenderContext, IChatContentPart } from './chatContentParts.js';
import { IChatRendererContent, isResponseVM } from '../../common/chatViewModel.js';
import { IChatRendererContent } from '../../common/chatViewModel.js';
import { ThinkingDisplayMode } from '../../common/constants.js';
import { ChatTreeItem } from '../chat.js';
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
Expand Down Expand Up @@ -49,7 +49,6 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
private headerButton: ButtonWithIcon | undefined;
private lastExtractedTitle: string | undefined;
private hasMultipleItems: boolean = false;
private modelId: string | undefined;

constructor(
content: IChatThinkingPart,
Expand All @@ -65,11 +64,6 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
super(extractedTitle, context);

this.id = content.id;

if (isResponseVM(context.element) && context.element.model.request?.modelId) {
this.modelId = context.element.model.request.modelId;
}

const configuredMode = this.configurationService.getValue<ThinkingDisplayMode>('chat.agent.thinkingStyle') ?? ThinkingDisplayMode.Collapsed;

this.fixedScrollingMode = configuredMode === ThinkingDisplayMode.FixedScrolling;
Expand Down Expand Up @@ -169,11 +163,10 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
return;
}

// If the entire content is bolded, strip the bold markers for rendering
let contentToRender = cleanedContent;
if (this.modelId?.includes('codex')) {
if (cleanedContent.startsWith('**') && cleanedContent.endsWith('**')) {
contentToRender = cleanedContent.slice(2, -2);
}
if (cleanedContent.startsWith('**') && cleanedContent.endsWith('**')) {
contentToRender = cleanedContent.slice(2, -2);
Comment on lines +168 to +169
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bold stripping logic is too simplistic and may incorrectly strip valid markdown bold markers. If the content is 'Bold text more', this would incorrectly strip the outer markers leaving 'Bold** text **more' which is malformed markdown. Consider checking that the content doesn't contain any other bold markers between the start and end, or use a more robust regex-based approach to detect if the entire content is a single bold block.

Suggested change
if (cleanedContent.startsWith('**') && cleanedContent.endsWith('**')) {
contentToRender = cleanedContent.slice(2, -2);
const boldBlockMatch = cleanedContent.match(/^\*\*(.+)\*\*$/s);
if (boldBlockMatch) {
contentToRender = boldBlockMatch[1];

Copilot uses AI. Check for mistakes.
}

const target = reuseExisting ? this.markdownResult?.element : undefined;
Expand Down
Loading