Auto-compact on idle, aligned to the model's prompt cache TTL
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Description
Describe the feature or problem you'd like to solve
Prompt cache TTL is ~5 min. After an idle gap the next turn re-reads the full context uncached, at a cost and latency that scale with context size. Compaction only triggers on token thresholds today (#1688, #2333), so the only workaround is running /compact manually before going idle.
Proposed solution
A time-based compaction trigger, with the idle threshold tied to the active model's cache TTL.
Example prompts or workflows
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing token-threshold compaction flow and where the active model's prompt cache TTL is available. Define the idle trigger around that TTL, then verify that the next turn after an idle gap uses the compacted context rather than rereading the full uncached context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100