Skip to content

fix(core): honor compaction disable settings#32864

Open
TonyReg wants to merge 3 commits into
anomalyco:devfrom
TonyReg:compaction-disable
Open

fix(core): honor compaction disable settings#32864
TonyReg wants to merge 3 commits into
anomalyco:devfrom
TonyReg:compaction-disable

Conversation

@TonyReg

@TonyReg TonyReg commented Jun 18, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #32385

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR makes the compaction disable settings take effect in both config loading and V2 provider-overflow recovery.

  • Applies OPENCODE_DISABLE_AUTOCOMPACT and OPENCODE_DISABLE_PRUNE as highest-priority core config overrides so environment variables win over lower-priority config files.
  • Prevents compactAfterOverflow from auto-compacting when compaction.auto is disabled.
  • Adds focused regressions covering the env overrides and the disabled provider-overflow recovery path.

This fixes the issue where users could set compaction.auto: false or OPENCODE_DISABLE_AUTOCOMPACT=true but still get automatic compaction after provider context overflow.

How did you verify your code works?

From packages/core:

  • bun test test/session-compaction.test.ts
  • bun test test/config-env.test.ts
  • bun test test/session-runner.test.ts --test-name-pattern "provider context overflow"
  • bun typecheck

Screenshots / recordings

Not applicable; this is a core/session behavior change with no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Reference: #32385

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search found two potentially related PRs that address compaction configuration:

  1. PR feat(session): add custom compaction thresholds along with prevention of continuous compaction #10123 - feat(session): add custom compaction thresholds along with prevention of continuous compaction

  2. PR fix(compaction): make compaction limits configurable and improve prompt detail retention #29324 - fix(compaction): make compaction limits configurable and improve prompt detail retention

These PRs may have overlapping concerns with the current PR #32864 regarding compaction configuration and auto-compaction behavior. You should review them to ensure there's no duplicate work, especially around config overrides and provider overflow recovery handling.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Compaction ignores "auto: false" config and OPENCODE_DISABLE_AUTOCOMPACT env vars

1 participant