Compaction bug - prompt token limit #7436

Closed
opened 2026-02-16 18:07:09 -05:00 by yindo · 4 comments
Owner

Originally created by @Genrie9 on GitHub (Jan 24, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Image

Plugins

No response

OpenCode version

latest

Steps to reproduce

1.use opus 4.5
2.fill in the context
3.run the command /compact

Screenshot and/or share link

Image

Operating System

Windows 10

Terminal

Powershell 7.5.4

Originally created by @Genrie9 on GitHub (Jan 24, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description <img width="1497" height="188" alt="Image" src="https://github.com/user-attachments/assets/d3f0f9c6-c1f1-42ce-9159-c5bae6a5b8e7" /> ### Plugins _No response_ ### OpenCode version latest ### Steps to reproduce 1.use opus 4.5 2.fill in the context 3.run the command /compact ### Screenshot and/or share link <img width="1497" height="188" alt="Image" src="https://github.com/user-attachments/assets/5ebc08d9-c587-44bc-ba01-545149b5af1d" /> ### Operating System Windows 10 ### Terminal Powershell 7.5.4
yindo added the windowsbug labels 2026-02-16 18:07:09 -05:00
yindo closed this issue 2026-02-16 18:07:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 24, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10342: /compact doesn't utilize prompt caching
  • #10017: Feature Request: Custom compaction threshold to trigger earlier
  • #8140: Feature Request: Configurable context limit and auto-compaction threshold
  • #6286: Compaction Failing to Run on Time
  • #6068: [BUG]: Auto compaction not triggering reliably with Anthropic models
  • #8089: Auto-compaction enabled by default, but context_length_exceeded errors still occur in agent workflows
  • #9349: config not work(feature compact)

These issues all involve compaction-related problems with prompt token limits and context management. Your issue specifically mentions using Opus 4.5 with a context fill followed by running /compact. Issues #6286 and #6068 describe similar symptoms where compaction fails with Opus models when context is nearly full, and issue #9349 reports auto-compaction failing to work properly even when configured.

Feel free to ignore if your specific case is distinct from these.

@github-actions[bot] commented on GitHub (Jan 24, 2026): This issue might be a duplicate of existing issues. Please check: - #10342: /compact doesn't utilize prompt caching - #10017: Feature Request: Custom compaction threshold to trigger earlier - #8140: Feature Request: Configurable context limit and auto-compaction threshold - #6286: Compaction Failing to Run on Time - #6068: [BUG]: Auto compaction not triggering reliably with Anthropic models - #8089: Auto-compaction enabled by default, but context_length_exceeded errors still occur in agent workflows - #9349: config not work(feature compact) These issues all involve compaction-related problems with prompt token limits and context management. Your issue specifically mentions using Opus 4.5 with a context fill followed by running /compact. Issues #6286 and #6068 describe similar symptoms where compaction fails with Opus models when context is nearly full, and issue #9349 reports auto-compaction failing to work properly even when configured. Feel free to ignore if your specific case is distinct from these.
Author
Owner

@chelebyy commented on GitHub (Feb 15, 2026):

I am experiencing this exact issue on Windows 11.

Crucial Update: I've discovered that this happens even in a completely empty directory. When I send a simple "hello", the system still tries to send ~377k tokens, specifically with a massive amount of tool input (~217k tokens).

This confirms that the bug isn't necessarily about the project size, but rather OpenCode incorrectly scanning global/system paths or failing to clear session context on Windows.

I've tested this with Kimi, GLM, and MiniMax (Free/Paid) and the behavior is identical across all providers.

Image
@chelebyy commented on GitHub (Feb 15, 2026): I am experiencing this exact issue on Windows 11. Crucial Update: I've discovered that this happens even in a completely empty directory. When I send a simple "hello", the system still tries to send ~377k tokens, specifically with a massive amount of tool input (~217k tokens). This confirms that the bug isn't necessarily about the project size, but rather OpenCode incorrectly scanning global/system paths or failing to clear session context on Windows. I've tested this with Kimi, GLM, and MiniMax (Free/Paid) and the behavior is identical across all providers. <img width="1112" height="554" alt="Image" src="https://github.com/user-attachments/assets/ba26e037-ca44-4550-bd60-d03729ad3b6e" />
Author
Owner

@rekram1-node commented on GitHub (Feb 15, 2026):

@chelebyy You are using a plugin for Omo, try using without that plugin, also feel free to share opencode debug config, I imagine you have a bunch of things being sent that are bloating context.

@rekram1-node commented on GitHub (Feb 15, 2026): @chelebyy You are using a plugin for Omo, try using without that plugin, also feel free to share `opencode debug config`, I imagine you have a bunch of things being sent that are bloating context.
Author
Owner

@chelebyy commented on GitHub (Feb 15, 2026):

@rekram1-node yes the problem is Omo
debug_config.txt

`

@chelebyy commented on GitHub (Feb 15, 2026): @rekram1-node yes the problem is Omo [debug_config.txt](https://github.com/user-attachments/files/25328689/debug_config.txt) `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7436