fix: trigger auto-compaction at the configured threshold#18951
fix: trigger auto-compaction at the configured threshold#18951jamestotah wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, here are the potentially related PRs (excluding PR #18951, which is the current PR): Related/Duplicate PRs:
These PRs should be reviewed to ensure PR #18951 doesn't duplicate existing work, particularly #10123 and #11931 which explicitly address configurable compaction thresholds. |
|
I checked the existing compaction flow before implementing this. This PR does not add a separate compaction mechanism - it reuses the current backend summarize/compaction path and makes it trigger proactively at the configured threshold while deduping in-flight compactions to avoid loops. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #11314
Refs #15533
Type of change
What does this PR do?
This reuses the existing session compaction flow to compact proactively once a completed assistant turn crosses a configurable context threshold.
It adds
compaction.threshold, triggers threshold-based auto-compaction in the backend after completed assistant turns, dedupes compaction requests while a session is already compacting, and adds aServer -> Sessionssettings surface in the app/Desktop UI.How did you verify your code works?
npm exec -- bun test test/session/compaction.test.tsnpm exec -- tsgo --noEmitinpackages/opencodenpm exec -- tsgo -binpackages/app5%in the app and verified a fresh session auto-compacted after crossing itScreenshots / recordings
Checklist