mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
fix(controller): "agent task already running" (#1516)
* fix agent task already running bug
* attemp to fix "Current task state not recognized"
* Revert "attemp to fix "Current task state not recognized""
This reverts commit f5cbfe1ebb.
---------
Co-authored-by: Leo <ifuryst@gmail.com>
This commit is contained in:
@@ -184,7 +184,8 @@ class AgentUnit:
|
||||
await self.send_error('No agent started. Please wait a second...')
|
||||
return
|
||||
try:
|
||||
assert not self.agent_task, 'Agent task already running'
|
||||
if self.agent_task:
|
||||
self.agent_task.cancel()
|
||||
self.agent_task = asyncio.create_task(
|
||||
self.controller.start(task), name='agent start task loop'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user