Gemma models return reasoning in `<thought>` tags – UI does not format/hide them

Open
#321,918 1 comment 0 reactions 1 assignee View on GitHub

@justschen is already working on this.

Since Jun 18, 2026.

Assessment

This issue has not been assessed yet.

Description

When using Gemma models (e.g., gemma-4-27b-a4b-it, gemma-4-21b-it) via the Google AI API , the model includes its reasoning/chain-of-thought inside <thought>...</thought> tags. The extension currently only strips or formats tags like <think> or <thinking>, leaving <thought> content rendered as plain text, which clutters the chat UI and breaks the intended clean display.

Environment:

  • Copilot Chat Extension Version: 0.54.0
  • VS Code Version:
  • OS Version: windows 11
  • Feature: Ask/Edit mode (both)
  • Selected model: Gemma 4 31B and 27B (via custom endpoint)

Steps to Reproduce:

  1. Configure the extension to use the Google AI API with a Gemma model.
  2. Send a prompt that triggers reasoning (e.g., a math problem or coding puzzle).
  3. Observe the response – the model outputs a <thought> block containing its internal reasoning, followed by the final answer.
  4. The <thought> content appears as raw text in the chat panel, not collapsed or styled.

Expected Behavior:
The extension should treat <thought> tags similarly to <think>/<thinking> – i.e., either hide them entirely (since they are internal reasoning) or render them in a collapsible/separate section with a distinct style (e.g., grayed out, collapsed by default). This would keep the final answer clean and readable.

Actual Behavior:
The entire <thought> block is displayed verbatim, making the response messy and harder to parse, especially for lengthy reasoning.

Workaround (for now):
I cloned the copilot repo and applied support for .

Here is before

Image

Here is after

Image

Additional Context:
This affects all Gemma models served by Google . The model’s official documentation confirms it uses <thought> for internal reasoning. Many other tools (e.g., Ollama, LM Studio) already support stripping these tags, so it would be great if this extension could do the same.

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.