diff --git a/letta/services/context_window_calculator/context_window_calculator.py b/letta/services/context_window_calculator/context_window_calculator.py index 80fe7659..f8bb9ae3 100644 --- a/letta/services/context_window_calculator/context_window_calculator.py +++ b/letta/services/context_window_calculator/context_window_calculator.py @@ -39,10 +39,15 @@ class ContextWindowCalculator: Note: This method assumes a specific format with sections delimited by: , , and tags. + For git-memory-enabled agents, is used instead + of as the core memory delimiter. The extraction is position-based and expects sections in this order. """ base_start = system_message.find("") memory_blocks_start = system_message.find("") + if memory_blocks_start == -1: + # Git-memory-enabled agents render instead of + memory_blocks_start = system_message.find("") metadata_start = system_message.find("") system_prompt = ""