Skip to content

Commit cbfa590

Browse files
authored
Merge branch 'main' into img
2 parents ffcaabc + 0a23648 commit cbfa590

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
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
@@ -38,6 +38,10 @@ def should_condense(self, view: View) -> bool:
3838
def get_condensation(self, view: View) -> Condensation:
3939
head = view[: self.keep_first]
4040
target_size = self.max_size // 2
41+
if view.unhandled_condensation_request:
42+
# Condensation triggered by a condensation request
43+
# should be calculated based on the view size.
44+
target_size = len(view) // 2
4145
# Number of events to keep from the tail -- target size, minus however many
4246
# prefix events from the head, minus one for the summarization event
4347
events_from_tail = target_size - len(head) - 1

0 commit comments

Comments
 (0)