Skip to content

Commit 129b3b4

Browse files
author
Calvin Smith
committed
documentation, plus integration test fix
1 parent 11a41d5 commit 129b3b4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

openhands-sdk/openhands/sdk/context/condenser/llm_summarizing_condenser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ class LLMSummarizingCondenser(RollingCondenser):
4242
llm: LLM
4343
max_size: int = Field(default=240, gt=0)
4444
max_tokens: int | None = None
45+
4546
keep_first: int = Field(default=2, ge=0)
47+
"""Minimum number of events to preserve at the start of the view. The first
48+
`keep_first` events in the conversation will never be condensed or summarized.
49+
"""
4650

4751
@model_validator(mode="after")
4852
def validate_keep_first_vs_max_size(self):

tests/integration/tests/c02_hard_condensation_requirement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def condenser(self) -> LLMSummarizingCondenser:
4444
return LLMSummarizingCondenser(
4545
llm=condenser_llm,
4646
max_size=1000, # High to prevent automatic triggering
47-
keep_first=1,
47+
keep_first=4, # Set higher than normal to avoid a valid condensation range
4848
)
4949

5050
@property

0 commit comments

Comments
 (0)