copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

System/Tools consume 73% of context window (146k/200k), triggering auto-compaction on first message

Open MadEste opened this issue 6 months ago • 7 comments

With multiple MCP servers and plugins configured, the System/Tools section consumes 146k tokens — 73% of the 200k context window. This leaves negative free space before the user sends their first message, causing immediate auto-compaction in brand new sessions.

Reproduction

  1. Configure ~10 MCP servers (mix of builtin and custom)
  2. Install plugins that register additional tools and skills
  3. Have custom instruction files in ~/.copilot/copilot-instructions.md and .github/instructions/
  4. Start a new session
  5. Run /context

System/Tools: 146.4k (73%) Messages: 1.2k (1%) Free Space: -18383 (-9%) Buffer: 70.8k (35%)

Auto-compaction fires after the first interaction (~100 credits used), despite no meaningful conversation history to compact.

Environment

  • Copilot CLI v1.0.55-1
  • Windows 11, PowerShell
  • Model: Internal model
  • ~10 MCP servers configured across user and org plugins

Impact

  • Effectively unusable for multi-turn conversations without constant compaction
  • Credits wasted on compaction rather than productive work
  • Users with enterprise MCP setups hit this silently with no warning

MadEste avatar May 27 '26 17:05 MadEste

Update: Root cause narrowed to CLI version change

After further investigation, I found a 5.4x increase in system/tools overhead between CLI patch versions on the same machine, same model, same config:

Metric 1.0.55-1 1.0.55-5 Delta
System/Tools 26.1k (13%) 140.5k (70%) +114k (+5.4x)
Free Space 91.3k (46%) -11.3k (-6%) -102k
Usable? ✅ Yes ❌ No

Both sessions: same machine, same model same working directory, same 200k window, same 70.8k buffer, same MCP/plugin config. No user config changes between versions — the CLI auto-updated mid-day.

A session started on 1.0.55-1 earlier today is still working fine with 91k free. Every new session on 1.0.55-5 starts with negative free space and compacts after the first message.

MadEste avatar May 27 '26 17:05 MadEste

This is happening to me as well. Compacting after first message and then a loop of compactions that never ends.

Sockolet avatar May 28 '26 14:05 Sockolet

This is a huge blocker, even when the 1 million context window is set, I only get 200k and compaction loops are frequent:

Image

zahalzel avatar May 28 '26 14:05 zahalzel

Temporary workaround for unblocking myself and being able to work again:

winget uninstall GitHub.Copilot --force winget install GitHub.Copilot -v 1.0.54

then run with: 'copilot --no-auto-update' or 'copilot --yolo --no-auto-update'

Issue not present on this version.

Sockolet avatar May 29 '26 07:05 Sockolet

Just updated to 1.0.59 for testing and the bug is still present...

Sockolet avatar Jun 03 '26 06:06 Sockolet

@MadEste a lot has changed in how tool definitions use context since 1.0.55, including deferred loading of MCP tools via tool search and per-server token counts. Could you retry on the latest version (1.0.114+) and, if System/Tools is still unusually large, share your /context and /mcp output along with the model you're using?

hstaudacher avatar Nov 18 '26 16:11 hstaudacher

We're closing this because we couldn't make progress without the information requested above. If this still happens on the latest stable release (v1.0.117), please comment here with those answers and we'll reopen it.

hstaudacher avatar Nov 29 '26 10:11 hstaudacher