Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller): "agent task already running" #1516

Merged
merged 6 commits into from May 2, 2024

Conversation

xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented May 2, 2024

@xingyaoww xingyaoww changed the title Fix: agent task already running fix(controller): agent task already running May 2, 2024
Copy link
Collaborator

@amanape amanape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pausing or restarting the agent does not work. (responds with a "Current task state not recognized." message)

@xingyaoww xingyaoww marked this pull request as ready for review May 2, 2024 11:59
@xingyaoww
Copy link
Collaborator Author

@amanape should be fixed in the new commit!

@xingyaoww xingyaoww force-pushed the xw/fix-agent-task-already-running branch from 3d38dc8 to f5cbfe1 Compare May 2, 2024 12:10
@xingyaoww xingyaoww changed the title fix(controller): agent task already running fix(controller): agent task already running AND "Current task state not recognized" May 2, 2024
@xingyaoww xingyaoww changed the title fix(controller): agent task already running AND "Current task state not recognized" fix(controller): "agent task already running" AND "Current task state not recognized" May 2, 2024
@amanape
Copy link
Collaborator

amanape commented May 2, 2024

image

Model: gpt-3.5-turbo
Agent: CodeActAgent

I can't seem to replicate this behavior every time. But the buttons don't seem react either now. I can't seem to pause, or restart. UI does not change. Anybody else can confirm?

@xingyaoww
Copy link
Collaborator Author

xingyaoww commented May 2, 2024

@amanape, this seems to be a much more complex issue that involves the front end. How about i revert the attempted fix for "Current task state not recognized", and starts a separate PR for this? I can reproduce some of the behavior (e.g., reset button doesn't work, pause state propagate to the backend but UI does not change, etc), but I guess this will take more time to figure out.

New PR for this: #1517

@xingyaoww xingyaoww changed the title fix(controller): "agent task already running" AND "Current task state not recognized" fix(controller): "agent task already running" May 2, 2024
@rbren
Copy link
Collaborator

rbren commented May 2, 2024

🤔 this seems like a legit error to me--in what case do we get a START without getting a cancel first?

@amanape
Copy link
Collaborator

amanape commented May 2, 2024

@rbren There seem to be more issues with the agent actions than appear on the surface. I'm not sure if it was due to recent merges or they were dormant for a while.

For example, I managed to achieve a ValueError: Task (state: TaskState.PAUSED) is not in a state to add user message error than resulted in an unpaused state in the FE and paused state in the BE. This also somehow ended up rendering the <LoadPreviousSessionModal> every message after.

I'll take a peek into the FE later today and see if I can find anything. Worth setting up tests for these too

@xingyaoww
Copy link
Collaborator Author

xingyaoww commented May 2, 2024

@rbren This PR basically reverts changes I made at #1290. The reason I add that assert statement is we had a start_task_or_chat function, which we kinda disabled the ability to reset task.

Later your proposed PR broke this function down to start_task and some add_user_message function, but we forget to change the assert back :(

This is necessary in the sense that you need to kill existing task to be able to start a new one.

@xingyaoww xingyaoww enabled auto-merge (squash) May 2, 2024 15:26
@xingyaoww xingyaoww merged commit 1e50d58 into main May 2, 2024
23 checks passed
@xingyaoww xingyaoww deleted the xw/fix-agent-task-already-running branch May 2, 2024 15:33
yimothysu pushed a commit to yimothysu/OpenDevin that referenced this pull request May 3, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: The Agent stuck when error occurred in loop.
4 participants