Expand description
Compact overflow detection.
Determines when the conversation context is approaching or exceeding the model’s context window, triggering compaction before or after a provider turn.
Ported from OpenCode V1: packages/opencode/src/session/overflow.ts.
Constants§
- COMPACTION_
BUFFER - Token headroom reserved between context limit and compaction trigger.
Functions§
- is_
overflow - Returns
truewhen the conversation history exceeds the usable context window. - usable_
tokens - Computes the number of tokens available for conversation history.