github / github/copilot-cli

Auto-compact on idle, aligned to the model's prompt cache TTL

Open
#4,724 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:context-memory area:models
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.