fix: trigger auto-compaction at the configured threshold#18951
fix: trigger auto-compaction at the configured threshold#18951jamestotah wants to merge 1 commit intoanomalyco:devfrom
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. 👍 |
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