π OpenHands: AI-Driven Development
Fix step count out-of-sync bug when child agent fails (#3680)
Boxuan Li1e2796e1685c
diff --git a/openhands/controller/agent_controller.py b/openhands/controller/agent_controller.pyindex d510d651cc..ae32f0f351 100644--- a/openhands/controller/agent_controller.py+++ b/openhands/controller/agent_controller.py@@ -365,10 +365,14 @@ class AgentController:f'[Agent Controller {self.id}] Delegate state: {delegate_state}')if delegate_state == AgentState.ERROR:+ # update iteration that shall be shared across agents+ self.state.iteration = self.delegate.state.iteration+# close the delegate upon errorawait self.delegate.close()self.delegate = Noneself.delegateAction = None+await self.report_error('Delegator agent encounters an error')returndelegate_done = delegate_state in (AgentState.FINISHED, AgentState.REJECTED)