mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 14:52:25 +00:00
fix(opencode): add input limit for compaction (#8465)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user