Skip to content

Trim local agent system message so leading codespans render#319024

Merged
anthonykim1 merged 1 commit into
mainfrom
anthonykim1/weirdRenderingInChatOutput
May 29, 2026
Merged

Trim local agent system message so leading codespans render#319024
anthonykim1 merged 1 commit into
mainfrom
anthonykim1/weirdRenderingInChatOutput

Conversation

@anthonykim1
Copy link
Copy Markdown
Contributor

@anthonykim1 anthonykim1 self-assigned this May 29, 2026
Copilot AI review requested due to automatic review settings May 29, 2026 17:16
@anthonykim1 anthonykim1 added this to the 1.123.0 milestone May 29, 2026
@anthonykim1 anthonykim1 marked this pull request as ready for review May 29, 2026 17:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes local agent system message rendering by trimming surrounding whitespace before wrapping the system message in markdown emphasis, allowing leading code spans to render correctly.

Changes:

  • Trims system message content in buildChatHistory before creating the markdown response part.
  • Adds a regression test covering leading/trailing whitespace around a system message containing a code span.
Show a summary per file
File Description
extensions/copilot/src/extension/chatSessions/vscode-node/chatHistoryBuilder.ts Trims system message content before markdown formatting.
extensions/copilot/src/extension/chatSessions/vscode-node/test/chatHistoryBuilder.spec.ts Adds regression coverage for whitespace-trimmed system message rendering.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@anthonykim1 anthonykim1 enabled auto-merge (squash) May 29, 2026 18:05
@anthonykim1 anthonykim1 merged commit e3f06b6 into main May 29, 2026
26 checks passed
@anthonykim1 anthonykim1 deleted the anthonykim1/weirdRenderingInChatOutput branch May 29, 2026 18:15
const msg = messages[i];
if (msg.message.role === 'system') {
const content = (msg.message as { role: 'system'; content: string }).content;
const content = (msg.message as { role: 'system'; content: string }).content.trim();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't look right. This looks like a claude code route and not a system notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local agent system message rendering issue

4 participants