Skip to content

Commit

Permalink
Add NullObservation to trigger the next step
Browse files Browse the repository at this point in the history
Fixes #221
  • Loading branch information
SmartManoj committed Jan 20, 2025
1 parent dbcec54 commit ea3b409
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openhands/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,10 @@ async def _step(self) -> None:
# Save the ID of the first event in our truncated history for future reloading
if self.state.history:
self.state.start_id = self.state.history[0].id
# Don't add error event - let the agent retry with reduced context
# Add a NullObservation to the event stream to trigger the agent to retry
self.event_stream.add_event(
NullObservation(''),EventSource.AGENT,
)
return
raise

Expand Down

0 comments on commit ea3b409

Please sign in to comment.