Fix sliding window cutoff logic (#9261)

* fix sliding window cutoff calculations to use agent instead of summarizer config

* allow approval messages with tool_calls as valid cutoffs, prevent approval pairs from being split

* update tests with updated sliding window parameters

---------

Co-authored-by: Amy Guan <amy@letta.com>
This commit is contained in:
amysguan
2026-02-03 22:05:02 -08:00
committed by Caren Thomas
parent b89387bf38
commit 16c96cc3c0
4 changed files with 25 additions and 10 deletions

View File

@@ -1157,6 +1157,7 @@ async def test_sliding_window_cutoff_index_does_not_exceed_message_count(server:
summary, remaining_messages = await summarize_via_sliding_window(
actor=actor,
llm_config=llm_config,
agent_llm_config=llm_config, # case where agent and summarizer have same config
summarizer_config=summarizer_config,
in_context_messages=messages,
)