mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
Update max allowed size
This commit is contained in:
parent
88e4217878
commit
172aaa524b
1 changed files with 1 additions and 1 deletions
|
|
@ -1318,7 +1318,7 @@ ${this.customInstructions.trim()}
|
|||
)
|
||||
const totalTokens = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0)
|
||||
const contextWindow = this.api.getModel().info.contextWindow
|
||||
const maxAllowedSize = Math.max(contextWindow - 20_000, contextWindow * 0.8)
|
||||
const maxAllowedSize = Math.max(contextWindow - 40_000, contextWindow * 0.8)
|
||||
if (totalTokens >= maxAllowedSize) {
|
||||
const truncatedMessages = truncateHalfConversation(this.apiConversationHistory)
|
||||
await this.overwriteApiConversationHistory(truncatedMessages)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue