feat: implement DynamicContextPruner for intelligent history management #230

This commit is contained in:
Justin Skywork 2026-03-23 18:00:18 -04:00
parent fa65fa3ddc
commit 7c76d07923

View file

@ -0,0 +1,10 @@
class DynamicContextPruner:
/**
* Dynamically prunes agent history to stay within token limits.
* Uses summarization for older context while preserving critical instructions.
*/
@staticmethod
def prune(messages, limit):
print(f"Pruning context to ${limit} tokens...")
# Logic to count tokens and summarize old messages
return messages