MCPcopy Index your code
hub / github.com/anomalyco/opencode / isOverflow

Function isOverflow

packages/opencode/src/session/overflow.ts:22–34  ·  view source on GitHub ↗
(input: {
  cfg: ConfigV1.Info
  tokens: SessionV1.Assistant["tokens"]
  model: Provider.Model
  outputTokenMax?: number
})

Source from the content-addressed store, hash-verified

20}
21
22export 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}

Callers 1

processor.tsFile · 0.90

Calls 1

usableFunction · 0.70

Tested by

no test coverage detected