mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
Minor refactoring: remove step and task-creation in AgentController (#7981)
This commit is contained in:
committed by
GitHub
parent
0b40f6fac8
commit
5b5adc5c7b
@@ -293,9 +293,6 @@ class AgentController:
|
||||
# Set the agent state to ERROR after storing the reason
|
||||
await self.set_agent_state_to(AgentState.ERROR)
|
||||
|
||||
def step(self):
|
||||
asyncio.create_task(self._step_with_exception_handling())
|
||||
|
||||
async def _step_with_exception_handling(self):
|
||||
try:
|
||||
await self._step()
|
||||
@@ -416,7 +413,7 @@ class AgentController:
|
||||
f'Stepping agent after event: {type(event).__name__}',
|
||||
extra={'msg_type': 'STEPPING_AGENT'},
|
||||
)
|
||||
self.step()
|
||||
await self._step_with_exception_handling()
|
||||
elif isinstance(event, MessageAction) and event.source == EventSource.USER:
|
||||
# If we received a user message but aren't stepping, log why
|
||||
self.log(
|
||||
|
||||
Reference in New Issue
Block a user