Skip to content

Commit

Permalink
fix(controller): "agent task already running" (OpenDevin#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 <[email protected]>
  • Loading branch information
2 people authored and yimothysu committed May 3, 2024
1 parent 3c7d19c commit f738ef3
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 f738ef3

Please sign in to comment.