Skip to content

Commit

Permalink
warn on state restore when the stream is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
enyst committed Dec 31, 2024
1 parent a66c7cc commit 184b1ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openhands/server/session/agent_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ def _create_controller(
try:
restored_state = State.restore_from_session(self.sid, self.file_store)
except Exception as e:
logger.debug(f'State could not be restored: {e}')
if self.event_stream.get_latest_event_id() > 0:
# if we have events, we should have a state
logger.warning(f'State could not be restored: {e}')

# Set the initial state through the controller.
controller.set_initial_state(restored_state, max_iterations, confirmation_mode)
Expand Down

0 comments on commit 184b1ea

Please sign in to comment.