fix(opencode): add input limit for compaction (#8465)
This commit is contained in:
parent
92931437c4
commit
8d720f9463
1 changed files with 47 additions and 34 deletions
|
|
@ -34,7 +34,7 @@ export namespace SessionCompaction {
|
|||
if (context === 0) return false
|
||||
const count = input.tokens.input + input.tokens.cache.read + input.tokens.output
|
||||
const output = Math.min(input.model.limit.output, SessionPrompt.OUTPUT_TOKEN_MAX) || SessionPrompt.OUTPUT_TOKEN_MAX
|
||||
const usable = context - output
|
||||
const usable = input.model.limit.input || context - output
|
||||
return count > usable
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue