mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
feat: make the response of agent_controller better to process when exception in step execution (#1445)
* feat: make the response of agent_controller better to process when exception occurred during executing step. * Update opendevin/controller/agent_controller.py --------- Co-authored-by: aaren.xzh <aaren.xzh@antfin.com> Co-authored-by: Robert Brennan <accounts@rbren.io>
This commit is contained in:
parent
fa067edbac
commit
086a2ed17f
@ -99,9 +99,12 @@ class AgentController:
|
||||
finished = await self.step(i)
|
||||
if finished:
|
||||
self._task_state = TaskState.FINISHED
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logger.error('Error in loop', exc_info=True)
|
||||
raise e
|
||||
await self._run_callbacks(
|
||||
AgentErrorObservation('Oops! Something went wrong while completing your task. You can check the logs for more info.'))
|
||||
await self.set_task_state_to(TaskState.STOPPED)
|
||||
break
|
||||
|
||||
if self._task_state == TaskState.FINISHED:
|
||||
logger.info('Task finished by agent')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user