(input: { tokens: MessageV2.Assistant["tokens"]; model: Provider.Model })
| 31 | } |
| 32 | |
| 33 | export function isOverflow(input: { tokens: MessageV2.Assistant["tokens"]; model: Provider.Model }) { |
| 34 | if (Flag.ARCTIC_DISABLE_AUTOCOMPACT) return false |
| 35 | const context = input.model.limit.context |
| 36 | if (context === 0) return false |
| 37 | const count = input.tokens.input + input.tokens.cache.read + input.tokens.output |
| 38 | const output = Math.min(input.model.limit.output, SessionPrompt.OUTPUT_TOKEN_MAX) || SessionPrompt.OUTPUT_TOKEN_MAX |
| 39 | const usable = context - output |
| 40 | return count > usable |
| 41 | } |
| 42 | |
| 43 | export const PRUNE_MINIMUM = 20_000 |
| 44 | export const PRUNE_PROTECT = 40_000 |
nothing calls this directly
no outgoing calls
no test coverage detected