Skip to content

Commit

Permalink
fix(controller): "agent task already running" (#1516)
Browse files Browse the repository at this point in the history
* 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 f5cbfe1.

---------

Co-authored-by: Leo <ifuryst@gmail.com>
  • Loading branch information
xingyaoww and iFurySt committed May 2, 2024
1 parent 24750ba commit 1e50d58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opendevin/server/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ async def start_task(self, start_event):
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'
)
Expand Down

0 comments on commit 1e50d58

Please sign in to comment.