2 hours ago · 8 min read1675 words · Tech · 0 comments

LLMs have limited context windows. When an agent session grows too long, VS Code Copilot Chat uses compaction to summarize older history while keeping recent work verbatim. I traced exactly how it works from the source. The standalone `microsoft/vscode-copilot-chat` repo was **archived in May 2026**. The agent code now lives in the main [microsoft/vscode](https://github.com/microsoft/vscode) repo under `extensions/copilot/`, and it has changed since the standalone repo froze. Everything below is traced against the current `extensions/copilot` source. Source files (all under extensions/copilot/): src/extension/intents/node/agentIntent.ts — budget math, trigger logic src/extension/prompts/node/agent/summarizedConversationHistory.tsx — prompt, LLM call, history selection, re-insertion src/extension/prompts/node/agent/backgroundSummarizer.ts — the async state machine and thresholds src/extension/prompts/node/agent/simpleSummarizedHistoryPrompt.tsx — the Simple-mode fallback Microsoft…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.