-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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]: Cannot recover from "Agent stuck in loop" #5480
Comments
@openhands-agent any idea? |
An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named 'openhands-fix-issue-5480' has been created with the attempted changes. You can view the branch here. Manual intervention may be required. |
This proposal is rather tough: main...openhands-fix-issue-5480#diff-1e082f415afb40de1d5c2a3fa327326225e1da28a142ad89c9524109f35fb36eR197 @openhands-agent Can you look at how traffic control is implemented, paused in the UI when necessary, and restarting later when the user does something? That can serve as example for this issue. |
A potential fix has been generated and a draft PR #5500 has been created. Please review the changes. |
- Add UI mode awareness to stuck detection - Only consider history after last user message in UI mode - Keep existing behavior in headless mode - Add comprehensive tests for both modes Fix: #5480
- Use headless_mode flag to determine stuck detection behavior - In interactive mode (not headless), only consider history after last user message - Keep existing behavior in headless mode - Add comprehensive tests for both modes Fix: #5480
@avi12 It's fixed on |
I'd appreciate it if you could update the documentation accordingly |
Sorry, I should clarify, the It's up to you, though, if you want to get the fix earlier: you can run |
Thank you for the information, it's worth mentioning both |
@enyst I'm on the main branch |
Was the Pause/Stop button available? I'm trying to reproduce the issue. |
As far as I can tell, whenever the agent is oscillating between two prompts and can't get to a different prompt, at some point it will tell me that the agent got stuck in a loop, which makes sense |
Right! But when you send a message, actually typed words and send to the agent, did it restart its actions? |
Ah, if I see this right... it did several more steps, and got stuck later again. What model are you using? |
@CitroenGames There is another issue for that, please see here, and feel free to add your experience: I would still love to hear what model / provider are you using, when you are getting a lot of stuck cases. It does matter! The model decides what steps to perform. |
https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct-GGUF running via https://lmstudio.ai |
@BradKML Funny enough, when used https://huggingface.co/matteogeniaccio/phi-4 I encountered #4586 (comment) |
After trying out https://huggingface.co/lmstudio-community/Yi-Coder-9B-Chat-GGUF, I reproduced the error https://www.all-hands.dev/share?share_id=3a4846c320bba583aa836da5dcafe53712c08a42d8020f345edeaeab8b7c623f |
@kasinadhsarma I think it partially has to do with the LLM that you choose, try the one that OH recommends, Claude 3.5 Sonnet |
@avi12 could it work with the OpenRouter version of Sonnet, or official only? |
IDK, I haven't gone that far |
Is there an existing issue for the same bug?
Describe the bug and reproduction steps
Once we stuck in "agent stuck in loop", we cannot send subsequent messages to the agent anymore.
OpenHands Installation
Docker command in README
OpenHands Version
No response
Operating System
None
Logs, Errors, Screenshots, and Additional Context
No response
The text was updated successfully, but these errors were encountered: