Skip to main content

Module overflow

Module overflow 

Source
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 true when the conversation history exceeds the usable context window.
usable_tokens
Computes the number of tokens available for conversation history.