Skip to content

feat(core): support percentage compaction buffer - #36674

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
compaction-percent
Closed

opencode-agent[bot] wants to merge 1 commit into
devfrom
compaction-percent

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • accept { "percent": number } for compaction.buffer while preserving integer token buffers
  • calculate percentage buffers from each model context window
  • keep requested output allowance as the earlier compaction trigger
  • validate percentages from 0 through 100

Tests

  • bun test test/session-runner.test.ts --test-name-pattern "automatically compacts into a completed summary"
  • bun test test/config/config.test.ts
  • bun typecheck

@opencode-agent

Copy link
Copy Markdown
Contributor Author

Closing: the buffer represents fixed headroom needed to avoid overflow on the next turn, not a target context-utilization ratio, so scaling it with the context window is the wrong model.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants