AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

SSHing into remote server hangs Auto-GPT

Open Benjman opened this issue 2 years ago • 2 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Linux

Which version of Auto-GPT are you using?

Stable (branch)

GPT-3 or GPT-4?

GPT-4

Steps to reproduce 🕹

  • Does it work on stable branch? No
  • Does it work on master branch? No
  • Search for existing issues. Could not find issues related to SSH.
  • Ask on our Discord Asked several times without receiving any response.
  • Provide relevant info
    • master git hash 6b4ad1f933dee86dfc272ee6b7d1e43826c6cffb
    • stable git hash 91537b049625b6516f2b5f7361ae993d4e878a2e
  • Operating System Arch 6.2.11-arch1-1

Steps to reproduce

Give the following prompts:

Goal 1: SSH into server 1.1.1.1 Goal 2: Update packages

Auto-GPT responds with:

Using memory of type:  LocalCache
Using Browser:  firefox
 THOUGHTS:  I will SSH into the server 1.1.1.1 and update the packages.
REASONING:  I need to access the server to update the packages. SSH is the best way to do this. I will then use the package manager to update the packages.
PLAN:
-  SSH into the server
-  Use the package manager to update the packages
CRITICISM:  I need to ensure that I am using the correct package manager for the Arch distro.
NEXT ACTION:  COMMAND = execute_shell ARGUMENTS = {'command_line': 'ssh 1.1.1.1'}
Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for ...
Input:y
-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=
Executing command 'ssh 1.1.1.1' in working directory '/home/ben/.local/src/Auto-GPT/auto_gpt_workspace'

(ip address changed for description)

Current behavior 😯

I see that the Auto-GPT agent successfully SSHs into the server:

However, the agent hangs and will not continue. The last line of the prompt above is where it gets stuck. Ctrl+c does not affect the session, I have to force close the terminal.

Expected behavior 🤔

Successfully recognizes it has SSH'd into the server, and continues with the next goal.

Your prompt 📝

No response

Your Logs 📒

2023-04-27 11:52:33,828 INFO Welcome back!  Would you like me to return to being Web server configurer?
2023-04-27 11:53:07,387 INFO Using memory of type: LocalCache
2023-04-27 11:53:07,508 INFO Using Browser: firefox
2023-04-27 11:53:22,554 INFO  THOUGHTS: I need to ssh into the server aliased as `bscore02` to begin configuring the web server.
2023-04-27 11:53:22,944 INFO REASONING: I will use the `ssh` command to connect to the server.
2023-04-27 11:53:23,246 INFO PLAN: 
2023-04-27 11:53:23,295 INFO -  Use `ssh` command to connect to the server.
2023-04-27 11:53:23,557 INFO CRITICISM: I need to ensure that I have the correct credentials to connect to the server.
2023-04-27 11:53:23,901 INFO NEXT ACTION:  COMMAND = execute_shell  ARGUMENTS = {'command_line': 'ssh bscore02'}
2023-04-27 11:53:27,618 INFO -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= 

Benjman avatar Apr 27 '23 17:04 Benjman

I would really like to know if this is reproducible for anybody else. Are SSH capabilities generally not available in Auto-GPT?

Benjman avatar Apr 28 '23 04:04 Benjman

For a potential solution, see: https://github.com/Significant-Gravitas/Auto-GPT/issues/1554#issuecomment-1529127850

For the likely background info, please see: #1327 and #346 (popening a connection is one thing, telling an agent to also interact with that connection is a different matter though)

EDIT: Thinking about it, if the shell_execute command were generally to go through ssh locally, too - that would simplify the whole setup quite a bit actually, and you'd get a ton of functionality for free (think clustering). In the meantime, you could probably come up with a "remote_shell_execute" equivalent - the issue however remains that you could potentially be handling a numer of different machines (not to mention SSH tunneling). And the system is already struggling to look up proper OS details and version numbers of installed tools - so, you'd basically have to run lsb_release -a before executing any remote commands, and you'd want to run the tool in question beforehand, too - basically some sort of preparation stage:

  • lsb_release -a
  • $TOOL --version

if you don't do that, you will easily confuse the whole LLM, because it cannot possibly juggle multiple hosts - unless you happen to use a special or shell prompt to communicate your "context" (machine)

For the sake of completeness: using ssh non-interactively should work "out of the box" (i.e. to run commands etc)

Boostrix avatar May 01 '23 19:05 Boostrix

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.

github-actions[bot] avatar Sep 06 '23 21:09 github-actions[bot]

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar Sep 19 '23 01:09 github-actions[bot]