mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-07 22:14:03 -05:00
Optimize the condense conditions of the condenser (#11332)
Signed-off-by: CLFutureX <chenyongqyl@163.com> Co-authored-by: mamoodi <mamoodiha@gmail.com>
This commit is contained in:
@@ -55,7 +55,7 @@ class AmortizedForgettingCondenser(RollingCondenser):
|
||||
return Condensation(action=event)
|
||||
|
||||
def should_condense(self, view: View) -> bool:
|
||||
return len(view) > self.max_size
|
||||
return len(view) > self.max_size or view.unhandled_condensation_request
|
||||
|
||||
@classmethod
|
||||
def from_config(
|
||||
|
||||
@@ -116,7 +116,7 @@ class LLMAttentionCondenser(RollingCondenser):
|
||||
return Condensation(action=event)
|
||||
|
||||
def should_condense(self, view: View) -> bool:
|
||||
return len(view) > self.max_size
|
||||
return len(view) > self.max_size or view.unhandled_condensation_request
|
||||
|
||||
@classmethod
|
||||
def from_config(
|
||||
|
||||
@@ -158,7 +158,7 @@ CURRENT_STATE: Last flip: Heads, Haiku count: 15/20"""
|
||||
)
|
||||
|
||||
def should_condense(self, view: View) -> bool:
|
||||
return len(view) > self.max_size
|
||||
return len(view) > self.max_size or view.unhandled_condensation_request
|
||||
|
||||
@classmethod
|
||||
def from_config(
|
||||
|
||||
@@ -305,7 +305,7 @@ Capture all relevant information, especially:
|
||||
)
|
||||
|
||||
def should_condense(self, view: View) -> bool:
|
||||
return len(view) > self.max_size
|
||||
return len(view) > self.max_size or view.unhandled_condensation_request
|
||||
|
||||
@classmethod
|
||||
def from_config(
|
||||
|
||||
Reference in New Issue
Block a user