-
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
[Bug]: Headless mode tells the agent to continue over and over #5535
Comments
Yes, sorry, we should update the doc. Indeed the default is non-interactive for headless, now, and running interactively (the previous behavior) can be done with |
@mamoodi @enyst Right now you have conflicting instructions in your docs for headless mode. In the Docker command you keep listing the CLI option poetry run python -m openhands.core.main -t "write a bash script that prints hi" which doesn't have |
@bscriver123 oh yep. I'll update that. Thanks for bringing it up! |
Thanks. Nonetheless, @mamoodi, I don't think adding/removing this flag solves this issue on headless mode. I have been testing and when using Docker I get the following behaviour:
export WORKSPACE_BASE=$PWD
export LLM_API_KEY=
export LLM_MODEL=gpt-4o
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
-e LLM_MODEL=$LLM_MODEL \
-e LOG_ALL_EVENTS=true \
-v $WORKSPACE_BASE:/opt/workspace_base \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.17 \
python -m openhands.core.main -t "write a bash script that prints hi"
export WORKSPACE_BASE=$PWD
export LLM_API_KEY=
export LLM_MODEL=gpt-4o
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.17-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
-e LLM_MODEL=$LLM_MODEL \
-e LOG_ALL_EVENTS=true \
-v $WORKSPACE_BASE:/opt/workspace_base \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.17 \
python -m openhands.core.main -t "write a bash script that prints hi" --no-auto-continue |
@bscriver123 yes you're absolutely right. Can you create a bug for the second scenario please? With the flag it should not await user input. Rather, headless mode should not wait for user input after the first request. It should do the task and finish. |
@bscriver123 This is fixed by #5879 |
Thanks @li-boxuan! Then, I assume that WITH the flag |
WITH In other words, running |
Then @enyst, what @mamoodi "fixed" in the docs is again incorrect. We should remove the flag |
It's written this way because it was preserving an old behavior, but I agree we should write this the other way around, it will be clearer. That is, we can document both cases, like:
A PR is welcome if you want to take a stab at it! |
Okay! Will do and link the PR. |
Now I'm confused myself. I thought the whole idea of headless was that you give it a task and it should just finish the task. Once it finishes, the interaction should end. Otherwise how is it different than the CLI? |
I sort of understand now. This I believe was fixed on main. Without providing the flag, it will do the task and exit appropriately which is what headless is supposed to do. PR above should fix it. |
I'll take the rest of the discussion in the PR, just for the record @mamoodi 👍
There are other options, like changing the agent or the prompt or raise an error, but I don't think they would be good ideas, at least because we use Note: |
This is now fixed! |
Is there an existing issue for the same bug?
Describe the bug and reproduction steps
If you use the headless mode:
https://docs.all-hands.dev/modules/usage/how-to/headless-mode
after the agent completes the task (for example writing the hello world program), we keep sending it "continue". This makes the agent confused and then angry :D
OpenHands Installation
Docker command in README
OpenHands Version
No response
Operating System
None
Logs, Errors, Screenshots, and Additional Context
The text was updated successfully, but these errors were encountered: