Skip to content

Agent Zero AI framework

fix deadlock in ctx compression

frdel1db8e3f095e4
diff --git a/python/helpers/history.py b/python/helpers/history.py
index 0604bb4d9..45270bc48 100644
--- a/python/helpers/history.py
+++ b/python/helpers/history.py
@@ -377,7 +377,7 @@ class History(Record):
return False
target = total * COMPRESSION_TARGET_RATIO
- prev_total = curr + hist + bulk
+ prev_total = curr + hist + bulk + 1
while True:
curr, hist, bulk = (
self.get_current_topic_tokens(),