From f9f1c55c93efe55d962b9211aaebde0f1100288e Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Mon, 9 Feb 2026 23:43:55 -0800 Subject: [PATCH] fix: fix context preview for git (#9403) --- .../context_window_calculator/context_window_calculator.py | 5 +++++ 1 file changed, 5 insertions(+) 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 = ""