fix: prevent infinite optimization loop when all messages are tool outputs
This commit is contained in:
parent
9b0a48ac6d
commit
41cf4a5dcc
1 changed files with 2 additions and 0 deletions
|
|
@ -1508,6 +1508,8 @@ func (al *AgentLoop) summarizeSession(agent *AgentInstance, sessionKey string) {
|
|||
}
|
||||
|
||||
if len(validMessages) == 0 {
|
||||
agent.Sessions.TruncateHistory(sessionKey, 4)
|
||||
agent.Sessions.Save(sessionKey)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue