Repository navigation
Context size and compaction settings? #322
|
There are 3 places where "token threshold" is set:
How do these actually work in setting compaction thresholds? |
Replies: 1 comment
|
The model settings override the Chat threshold in this order:
For example, with Chat set to 90,000, model defaults set to 60,000, and one model set to 40,000, that model uses 40,000. A model without its own setting uses 60,000. The Chat setting is not a ceiling in the current resolver: a per-model value of 120,000 overrides a Chat value of 90,000. The compaction check triggers when context usage exceeds the chosen threshold. At exactly the threshold, it does not trigger. It uses provider-reported input plus output tokens when available, with estimates for newly added messages; otherwise it estimates the history and system prompt. I checked the upstream threshold and trigger functions with 43 local assertions, including all three settings, fallbacks, above-global values, and boundary cases. The configuration/database inputs were controlled; this did not run the full UI or an LLM summarization. Sources: threshold selection, compaction check. |
The model settings override the Chat threshold in this order:
chat.models["*"].For example, with Chat set to 90,000, model defaults set to 60,000, and one model set to 40,000, that model uses 40,000. A model without its own setting uses 60,000.
The Chat setting is not a ceiling in the current resolver: a per-model value of 120,000 overrides a Chat value of 90,000.
The compaction check triggers when context usage exceeds the chosen threshold. At exactly the threshold, it does not trigger. It uses provider-reported input plus output tokens when available,…