microsoft / microsoft/vscode

Copilot Chat: customizationsUpdate block re-injected identically on every turn, count grows unbounded across a long conversation

Open
#336,134 0 comments 0 reactions 1 assignee Claimed by @hediet View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Type: Bug

## Environment
- VS Code (stable), macOS
- Bundled Copilot Chat extension version at time of capture: this environment currently ships `0.65.0` (stable) / `0.62.2026081406` (Insiders); the original capture predates a subsequent auto-update so the exact build may differ slightly.
- Chat model provider: a third-party BYOK provider registered via a separate extension (routes to a non-Copilot backend over HTTP). Confirmed via log analysis that this provider extension only relays an already-built message array — it does not construct the system prompt.

## Summary
A `customizationsUpdate` prompt-tsx component (part of the bundled Copilot Chat extension's prompt-construction code) appears to re-inject a full, byte-identical copy of the workspace instructions/customizations listing into chat history on repeated turns of one long-running conversation, rather than only when the underlying instructions actually changed. Each re-injection becomes a permanent part of that turn's message and is then replayed on every subsequent request as ordinary history, so the count is monotonically non-decreasing for the life of the conversation.

## Evidence (structural only — no message content included)
Captured via VS Code's built-in Copilot Chat debug logging across one ~68-minute, 33-request conversation in a single workspace with a large repo-level instructions file (~187KB):

- Every occurrence of the `...` block across all 33 requests hashes identical: `sha256[:12] = a699466c23e4`, exact byte length `26,377` bytes. The content never changed once during the session.
- Block count per request, in chronological order: `1, 1, 2, 2, 2 (×24), 3, 3, 4, 5, 6, 7, 8, 9, 10, 11` — strictly non-decreasing.
- Spot-checked one mid-session request with 7 occurrences: the 7 blocks sit at 7 different historical message indices (not stacked repeatedly inside a single message), confirming this is cross-turn accumulation via chat history replay, not a single-request serialization loop.
- The extension's own "instructions/customizations changed" detector appears to be firing repeatedly despite the content never changing — i.e. a false-positive on the change-detection condition that gates this component's re-injection.
- No user-facing VS Code setting was found (checked `chat.*` and `github.copilot.*` settings) that disables or throttles this behavior.

## Impact
For a workspace with a large instructions surface, this causes unbounded, redundant growth of every request's context within one conversation — pure token waste with no functional benefit, and plausibly a contributing factor (not confirmed) in some very-long-duration/timeout requests observed in the same session.

## Repro sketch
1. Open a workspace with a sizeable instructions file that Copilot Chat picks up as a "customization" (e.g. a large `AGENTS.md`/`.github/copilot-instructions.md`).
2. Start one Copilot Chat conversation and keep it open across many turns (10+) without starting a new chat.
3. Capture the chat debug log (workspaceStorage `.../GitHub.copilot-chat/debug-logs//main.jsonl`).
4. For each request, count occurrences of `` in the system message and hash each occurrence's content.
5. Expect: hash stays identical across occurrences; count grows across turns even though the instructions file never changed during the session.

## Workaround in use
None available at the VS Code settings level. Procedural only: avoid single very-long-running conversations in a workspace with a large instructions surface — start a new chat when switching tasks, since the growth resets per-conversation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.