-
Notifications
You must be signed in to change notification settings - Fork 21
Description
In #683 and #684 we added auto-compaction when reaching a configurable percentage of the context window. This is great in scenarios where the user forgets to compact their chat regularly, as once the threshold is reached they can't send a message without first compacting. This has the advantage of not needing to interrupt the agent in order to perform the compaction, which may degrade chat quality.
However, this feature is of no value when the agent grows the context towards the limit within a single stream - before the user ever has a scenario to send a message, and even see the auto-compaction warning.
This issue is therefore to track interrupting the agent and performing a compaction as the context usage approaches the context window limit, approximately when context usage reaches:
context window - expected compaction tool call token count - tokens required for compaction prompt