Skip to content

Commit ea3b409

Browse files
committed
Add NullObservation to trigger the next step
Fixes #221
1 parent dbcec54 commit ea3b409

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

openhands/controller/agent_controller.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,10 @@ async def _step(self) -> None:
742742
# Save the ID of the first event in our truncated history for future reloading
743743
if self.state.history:
744744
self.state.start_id = self.state.history[0].id
745-
# Don't add error event - let the agent retry with reduced context
745+
# Add a NullObservation to the event stream to trigger the agent to retry
746+
self.event_stream.add_event(
747+
NullObservation(''),EventSource.AGENT,
748+
)
746749
return
747750
raise
748751

0 commit comments

Comments
 (0)