mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-11 12:18:59 +00:00
fix(agent): correct soft-trim head/tail budget allocation when tail is important (#723)
Co-authored-by: quxy5 <quxy5@outlook.com>
This commit is contained in:
1 parent
7fcf03273e
commit
7ef6d1d17a
1 file changed
+2
-2
@@ -205,8 +205,8 @@ func pruneContextMessages(msgs []providers.Message, contextWindowTokens int, cfg
|
||||
tailChars := settings.softTrimTailChars
|
||||
if hasImportantTail(msg.Content) {
|
||||
totalBudget := headChars + tailChars
|
||||
headChars = totalBudget * 7 / 10
|
||||
tailChars = totalBudget - headChars
|
||||
tailChars = totalBudget * 7 / 10
|
||||
headChars = totalBudget - tailChars
|
||||
}
|
||||
head := takeHead(msg.Content, headChars)
|
||||
tail := takeTail(msg.Content, tailChars)
|
||||
|
||||
Reference in new issue
Block a user