Expand description
Context window management defaults
Constantsยง
- AGGRESSIVE_
PRESERVE_ RECENT_ TURNS - Maximum number of recent turns to keep when aggressively reducing context
- CHAR_
PER_ TOKEN_ APPROX - Approximate character count per token when estimating context size
- CONTEXT_
ERROR_ RETRY_ LIMIT - Maximum number of retry attempts when the provider signals context overflow
- DEFAULT_
MAX_ TOKENS - Default maximum context window (in approximate tokens)
- DEFAULT_
PRESERVE_ RECENT_ TURNS - Default number of recent turns to preserve verbatim
- DEFAULT_
TRIM_ TO_ PERCENT - Trim target as a percentage of the maximum token budget
- MAX_
TRIM_ RATIO_ PERCENT - Maximum allowed trim percentage (prevents minimal trimming)
- MIN_
PRESERVE_ RECENT_ TURNS - Minimum number of recent turns that must remain after trimming
- MIN_
TRIM_ RATIO_ PERCENT - Minimum allowed trim percentage (prevents overly aggressive retention)