Skip to content

Commit

Permalink
fix initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
enyst committed Nov 14, 2024
1 parent d85debd commit 0b7c08d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openhands/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def _init_history(self):
events: list[Event] = []

# If we have a truncation point, get first user message and then rest of history
if hasattr(self.state, 'truncation_id') and self.state.truncation_id:
if hasattr(self.state, 'truncation_id') and self.state.truncation_id > 0:
# Find first user message from stream
first_user_msg = next(
(
Expand Down Expand Up @@ -822,7 +822,7 @@ def _apply_conversation_window(self, events: list[Event]) -> list[Event]:

# Handle first event in truncated history
if kept_events:
i = mid_point
i = 0
while i < len(kept_events):
first_event = kept_events[i]
if isinstance(first_event, Observation) and first_event.cause:
Expand Down

0 comments on commit 0b7c08d

Please sign in to comment.