Function
isOverflow
(input: {
cfg: ConfigV1.Info
tokens: SessionV1.Assistant["tokens"]
model: Provider.Model
outputTokenMax?: number
})
Source from the content-addressed store, hash-verified
| 20 | } |
| 21 | |
| 22 | export function isOverflow(input: { |
| 23 | cfg: ConfigV1.Info |
| 24 | tokens: SessionV1.Assistant["tokens"] |
| 25 | model: Provider.Model |
| 26 | outputTokenMax?: number |
| 27 | }) { |
| 28 | if (input.cfg.compaction?.auto === false) return false |
| 29 | if (input.model.limit.context === 0) return false |
| 30 | |
| 31 | const count = |
| 32 | input.tokens.total || input.tokens.input + input.tokens.output + input.tokens.cache.read + input.tokens.cache.write |
| 33 | return count >= usable(input) |
| 34 | } |
Tested by
no test coverage detected