Sfoglia il codice sorgente

Fix step count out-of-sync bug when child agent fails (#3680)

Boxuan Li 1 anno fa
parent
commit
1e2796e168
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      openhands/controller/agent_controller.py

+ 4 - 0
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 error
                 await self.delegate.close()
                 self.delegate = None
                 self.delegateAction = None
+
                 await self.report_error('Delegator agent encounters an error')
                 return
             delegate_done = delegate_state in (AgentState.FINISHED, AgentState.REJECTED)