Skip to content

needsCompaction

function needsCompaction(inputTokens, contextWindow): boolean;

Defined in: core/src/context.ts:74

The provider’s own input count says the limit is close. Fold before the next step rather than after the 400.

Takes the REPORTED count, not an estimate, because it is the only figure that is not a guess. Estimate only when there is no reported count yet.

Parameter Type
inputTokens number
contextWindow number

boolean