-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
shell command execution hangs AutoGPT forever #2459
Comments
Similar issue, nano and vim. |
After doing some research I've found that there doesn't really seem to be a solution for detecting if a program is blocking or non-blocking, meaning that the only method for mitigating this in a simple fashion is to set a time-out, which seems rather unfortunate. Hopefully, I'm wrong and someone smarter than me knows how to do so. |
SYSTEM: Command execute_shell returned: Error: [Errno 2] No such file or directory: '/home/appuser/autogpt/auto_gpt_workspace' |
This is a different issue, please find an issue that applies or create your own. |
how about to detach process then collect its logs and files? |
Same here, for example with running The culprit seems to be here:
A more complex solution could be to use |
the problem then is now computationally expensive operations will not work whatsoever, due to always being nuked. |
This is called the halting problem, and we won't solve it here without a timeout. May be worth opening a pr for it |
Update: the psutil stuff would work to recognize sleeping processes and those not doing much in terms of I/O: #4123
Note, the following won't solve the halting problem obviously, but we can look for blocking APIs and interrupt the child processes after a given timeout. More generally, adding a blacklist of interactive programs (nano, vim etc) would seem to suffice though: #1327 (comment) So, while this won't magically solve the halting problem, if a sub-process is using certain blocking API calls (or even just has got those listed in the ELF/PE file as imports), needs an excessive amount of time, and its resource utilization (CPU/RAM) isn't growing/varying over time (sleeping), it's probably a pretty safe candidate for being killed/restarted by the parent agent.
That would be another potential heuristics: GUI apps can be identified via their DLL/DSO imports (think X11 for gedit).
we could simply add a CSV blacklist of commands that shall not be executed, because these are known to interactive - given how frequently this issue has been raised here on the tracker, that would seem like a straightforward option to at least prevent people from getting stuck inside nano/vim More generally, there could also be a preference configured to use command line editors like sed/awk and perl when needed. |
Looks like you just need to add that folder. |
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days. |
This issue was closed automatically because it has been stale for 10 days with no activity. |
Which Operating System are you using?
Linux
GPT-3 or GPT-4?
GPT-3.5
Steps to reproduce 🕹
sudo python3 -m autogpt --continuous --gpt3only
y
Current behavior 😯
git rev-parse HEAD
89539d0
another one example
Expected behavior 🤔
skip execution of broken commands. Probably execute all shell commands in "&" (Linux) detached mode
Your prompt 📝
# Paste your prompt here
Your Logs 📒
The text was updated successfully, but these errors were encountered: