You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONFIGURATION.md
+72-1Lines changed: 72 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,7 +189,39 @@ Core compression behavior.
189
189
-**Type:**`number`
190
190
-**Default:**`5`
191
191
-**Status:** ACTIVE
192
-
-**Description:** Floor for growth-triggered nudges, as a percentage of the model context window: a growth nudge requires context usage at or above this percentage (in addition to the growth threshold). Over-max (`maxContextLimit`) and the 98% emergency-override nudges bypass the floor. If the model context window is unknown, the floor is unresolvable and growth nudges fall back to growth-only behavior. Turn/iteration reminder nudges are governed by `minContextLimit`, not this field. The default is deliberately low: with the default `nudgeGrowthTokens` (50K), a 5% floor stays inert for typical working cycles and only binds on very large (≥2M-class) windows — a higher default (e.g. 15%) would bind on ≥400K windows and shift every compress cycle's working range upward on large-window models. Set `0` to disable the floor entirely, or raise it (e.g. 15–30%) to keep growth nudges waiting until a larger share of the window is in use.
192
+
- **Description:** Floor for growth-triggered nudges, as a percentage of the model context window: a growth nudge requires context usage at or above this percentage (in addition to the growth threshold). Over-max (`maxContextLimit`) and the 98% emergency-override nudges bypass the floor. If the model context window is unknown, the floor is unresolvable and growth nudges fall back to growth-only behavior. Turn/iteration reminder nudges are governed by `minContextLimit`, not this field. The default is deliberately low: with the default `nudgeGrowthTokens` (50K), a 5% floor stays inert for typical working cycles and only binds on very large (≥2M-class) windows — a higher default (e.g. 15%) would bind on ≥400K windows and shift every compress cycle's working range upward on large-window models. Set `0` to disable the floor entirely, or raise it (e.g. 15–30%) to keep growth nudges waiting until a larger share of the window is in use. Can be narrowed per provider / per model via [`compress.providers`](#compressproviders) (issue #344).
193
+
194
+
#### `compress.providers`
195
+
-**Type:**`Record<string, ProviderOverrides>` where `ProviderOverrides = Partial<CompressOverridableConfig> & { models?: Record<string, Partial<CompressOverridableConfig>> }` (all fields optional at both levels)
196
+
-**Default:**`undefined`
197
+
-**Status:** ACTIVE
198
+
-**Description:** Nested per-provider / per-model overrides for **every tunable compress field**, resolved field-by-field with the cascade **model > provider > global** (mirrors the sibling project billion-context-pi, issue #344). Deeper levels only override when the field is explicitly set — unset fields never clear shallower values. `0` / `false` are explicit values, not "unset". Unknown provider/model ids fall back to the global value. Percentages and `"X%"` limits resolve against the active model's context window. Across the three config file layers (global → config dir → project) the maps deep-merge per provider/model key — a project layer can narrow one provider without wiping others configured in lower layers.
-**Not overridable:**`permission` (session-level, fixed before model info is known), the deprecated `minContextLimit` / `modelMinLimits` family, the flat `modelMaxLimits` map (legacy), and `providers` itself. For `maxContextLimit` the precedence when set nested is **nested override > `modelMaxLimits` flat map > global**. `protectedTools` set here affects the compress tool and nudge-side logic; the system-prompt protected-tools listing (shown at prompt build time, before model info is available) always reflects the global value.
201
+
202
+
```jsonc
203
+
{
204
+
"compress": {
205
+
"maxContextLimit":"55%",
206
+
"minNudgeContextPercent":5,
207
+
"nudgeGrowthTokens":50000,
208
+
"providers": {
209
+
"anthropic": {
210
+
"minNudgeContextPercent":8,
211
+
"nudgeForce":"strong",
212
+
"models": {
213
+
"claude-sonnet-4-6": {
214
+
"minNudgeContextPercent":30,
215
+
"maxContextLimit":"70%",
216
+
"nudgeGrowthTokens":20000
217
+
}
218
+
}
219
+
}
220
+
}
221
+
}
222
+
}
223
+
```
224
+
In this example, for `anthropic/claude-sonnet-4-6`: the floor is 30%, the over-max band starts at 70% of the window instead of the global 55% (a larger working range before over-max nudges kick in), the growth threshold is 20K, and nudges use the `strong` tone (inherited from the provider level). Every other Anthropic model gets the 8% floor and `strong` tone but keeps the global band and 50K growth threshold; everything else uses the pure global values. Provider keys are provider ids and model keys are model ids (as reported by the active session, e.g. `anthropic`, `claude-sonnet-4-6`).
193
225
194
226
#### `compress.nudgeGrowthTokens`
195
227
-**Type:**`number`
@@ -447,6 +479,45 @@ Post-compression quality evaluation. Runs after each compression to verify summa
Floors resolve as model > provider > global (field-by-field). `0` disables the floor for that model — useful for small-window models where the growth threshold alone is the right signal.
500
+
501
+
### Per-model tuning of any compress field (nested providers.models)
502
+
The same cascade works for every tunable field, not just the floor — e.g. give one heavy model a tighter growth threshold and a lower over-max band while its siblings keep the global profile:
503
+
```jsonc
504
+
{
505
+
"compress": {
506
+
"providers": {
507
+
"anthropic": {
508
+
"models": {
509
+
"claude-sonnet-4-6": {
510
+
"nudgeGrowthTokens":20000,
511
+
"maxContextLimit":"40%"
512
+
}
513
+
}
514
+
}
515
+
}
516
+
}
517
+
}
518
+
```
519
+
See the [`compress.providers`](#compressproviders) reference for the full overridable field list.
Resolution is **per field**: model > provider > global. Unknown provider/model IDs fall back to the global value. A nested `maxContextLimit` also wins over the legacy flat `modelMaxLimits` map. Overrides deep-merge across the three config layers (global → config dir → project) per provider/model key.
443
+
444
+
Not overridable here: `permission`, the deprecated `minContextLimit` family, and the flat `model*Limits` maps themselves.
445
+
446
+
See the [`compress.providers`](./CONFIGURATION.md#compressproviders) reference in CONFIGURATION.md for the full 23-field list and recipes.
0 commit comments