[FEATURE]: disable auto-compact option #2206

Closed
opened 2026-02-16 17:34:39 -05:00 by yindo · 4 comments
Owner

Originally created by @k1064190 on GitHub (Oct 21, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I don't want opencode to auto-compact before reaching full-context size.
Claude code already supports this feature and It's possible to manually use compact command when the model reach the full context.
This is very useful since auto-compact often doesn't work as I expect.

Originally created by @k1064190 on GitHub (Oct 21, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request I don't want opencode to auto-compact before reaching full-context size. Claude code already supports this feature and It's possible to manually use compact command when the model reach the full context. This is very useful since auto-compact often doesn't work as I expect.
yindo added the discussion label 2026-02-16 17:34:39 -05:00
yindo closed this issue 2026-02-16 17:34:39 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 21, 2025):

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

  • #1990: [Feature Request] Add User Controls for Context Management - requests manual control over context including commands like /tokens and /clear, which relates to wanting manual control over compaction timing
  • #3314: 2x token reported in TUI (share link obj ok) - compacts too early - reports that auto-compact is triggering too early, which aligns with your concern about auto-compact not working as expected
  • #668: auto-compact not working before maxTokens errors from provider - discusses issues with auto-compact timing and behavior

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 21, 2025): This issue might be a duplicate of existing issues. Please check: - #1990: [Feature Request] Add User Controls for Context Management - requests manual control over context including commands like /tokens and /clear, which relates to wanting manual control over compaction timing - #3314: 2x token reported in TUI (share link obj ok) - compacts too early - reports that auto-compact is triggering too early, which aligns with your concern about auto-compact not working as expected - #668: auto-compact not working before maxTokens errors from provider - discusses issues with auto-compact timing and behavior Feel free to ignore if none of these address your specific case.
Author
Owner

@simonxabris commented on GitHub (Oct 21, 2025):

(Not affiliated with the project just happened to see the issue)

There are two environment variables that could help you out:

OPENCODE_DISABLE_AUTOCOMPACT : This controls whether opencode triggers the a compaction when the token usage exceeds the context window. This should happen very infrequently.

OPENCODE_DISABLE_PRUNE: This control whether opencode automatically triggers pruning old tool call results to save context window.

I think what you want is setting OPENCODE_DISABLE_PRUNE to true, this will preserve everything in the context and then you can run /compact yourself when you want to.

@simonxabris commented on GitHub (Oct 21, 2025): (Not affiliated with the project just happened to see the issue) There are two environment variables that could help you out: `OPENCODE_DISABLE_AUTOCOMPACT` : This controls whether opencode triggers the a compaction when the token usage exceeds the context window. This should happen very infrequently. `OPENCODE_DISABLE_PRUNE`: This control whether opencode automatically triggers pruning old tool call results to save context window. I think what you want is setting `OPENCODE_DISABLE_PRUNE` to `true`, this will preserve everything in the context and then you can run `/compact` yourself when you want to.
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

@simonxabris nailed it

@rekram1-node commented on GitHub (Oct 21, 2025): @simonxabris nailed it
Author
Owner

@kajdo commented on GitHub (Oct 31, 2025):

@simonxabris just dropped by to say "THANK YOU MATE!"

@kajdo commented on GitHub (Oct 31, 2025): @simonxabris just dropped by to say "THANK YOU MATE!"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2206