-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat: Autonomous mode #2435
feat: Autonomous mode #2435
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @li-boxuan @xingyaoww for review.
if config.agent.is_autonomous: | ||
messages.append( | ||
{'role': 'agent', 'content': f'Iteration {state.iteration}'} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, the agent repeatedly gives step 1 for the given task. Renaming Iteration to step would be appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it gives a hint about how many steps it has tried.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand it either. Doesn't look right to me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think role == 'agent'
is a supported behavior of litellm, it should be user
message? Did you test the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Litellm doesn't check that but openai does. Ran with a custom model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit hestitant to merge this as is, unless we figure out a way to add a checkbox on the frontend that allows the user to select [autonomous mode].
I think a lot of OpenDevin's helpfulness comes from the ability to request inputs from the user, and i think it is probably not a good idea to completely remove this ability just to implement autonomous mode.
if config.agent.is_autonomous: | ||
messages.append( | ||
{'role': 'agent', 'content': f'Iteration {state.iteration}'} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think role == 'agent'
is a supported behavior of litellm, it should be user
message? Did you test the code?
I'd rather have an instantly working |
OHHH yes! This is what i want too -- something like But i still think when appropriate, the agent should still require input from the user. Otherwise, you'd need to educate the user first to "know there's a stop button that can do XYZ" which can increase the entry barrier. |
Is this PR just for a specific edge-case and does it warrant patching around the core that make it less maintainable? |
@xingyaoww, it is still a config. |
Therefore, I don't think it is good to merge unless we can solve (1) in a meaningful way - bc if (1) is not solved, user experience is not gonna change, and it basically means we are adding code that is not actively used by people. |
It's |
Because there has been no response to @mamoodi 's comments above, I am going to close this PR, but please feel free to explain and reopen if you think otherwise. |
I have already discussed this with @mamoodi in Slack as the PR has been waiting for the reviewers. And @xingyaoww also requested a review from @rbren Finally, there is a commit and a review request after the comment too. |
@mamoodi There are some commits and a request review after that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it takes so long for review --Just saw it!
I think this version looks good to me, just some nits, and I'll need to locally test this before approve it.
@SmartManoj can you share a screenshot of the modified frontend so reviewer can see its effect?
Already added in the description. |
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
This reverts commit 134ce6f.
The tooltip is a bit laggy in this PR. |
) | ||
action.content += user_msg # type: ignore | ||
action.wait_for_response = False # type: ignore | ||
return action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you probably don't need to change these on the backend, since you are already dispatching user messages on the FE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not dispatched on the front end. Changed here and parsed in FE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove changes from the backend so that it won't affect other things (e.g., eval), and move this message to dispatched by the frontend?
Ideally, the "auto mode" should just be a way for the user to say "i want to keep clicking the [continue] button when it comes up"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eval is not affected by this.
opendevin/core/config.py
Outdated
""" | ||
|
||
name: str = 'CodeActAgent' | ||
memory_enabled: bool = False | ||
memory_max_threads: int = 2 | ||
is_autonomous: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And why do we need this? I think is_autonoumous
can be entirely handled by the FE - no?
e.g., when the autonomous mode is enabled, whenever the agent is requesting user inputs, the FE will always send back a pre-defined user message, asking the agent to "continue". We can probably re-use the continue button logic - the "checkbox" will just work by keep clicking the "continue" button for the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the config and added it as an attribute to Agent. The Agent should behave differently when autonomous mode is enabled like when to detect the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need to change the backend AND the agent for the autonomous mode?
ref: #2435 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for different prompts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean by "for different prompts"? can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for different system prompts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? I don't want us to add unnecessary additional complexity to the repo unless there are a few specific examples showing the necessity. The "continue" button on FE does not need to be modified on the backend; why does this need to modify BE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add "
Implemented this in the frontend itself in #2782 Have any thoughts that the agent should be aware of the autonomous mode in the future? |
Close this in favor of #2782. @SmartManoj I think we might need the agent to be aware of this, but i don't yet see a clear reason / motivating example of doing so. |
Solves #1798.
For Future PRs: continue the previous task