OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: ctrl-c results in strange terminal outputs

Open neubig opened this issue 11 months ago • 1 comments

Is there an existing issue for the same bug?

  • [x] I have checked the existing issues.

Describe the bug and reproduction steps

I had a session where I asked openhands to perform a series of actions regarding running an npm server.

It ran into trouble after as sequence where:

  1. it ran a command that continued running (vite)
  2. I asked it a question ("is the app still running")
  3. It tried to find out (ps aux | grep vite)
  4. But it ended up getting this message
{
  "exit_code": -1,
  "hostname": null,
  "pid": -1,
  "prefix": "[Below is the output of the previous command.]\n",
  "py_interpreter_path": null,
  "suffix": "\n[Your command \"ps aux | grep vite\" is NOT executed. The previous command is still running - You CANNOT send new commands until the previous command is completed. By setting `is_input` to `true`, you can interact with the current process: You may wait longer to see additional output of the previous command by sending empty command '', send other commands to interact with the current process, or send keys (\"C-c\", \"C-z\", \"C-d\") to interrupt/kill the previous command before sending your new command.]",
  "username": null,
  "working_dir": null
}
  1. It ran npm run dev > vite.log 2>&1 &
  2. It ran ps aux | grep vite && echo "=== Log file contents ===" && cat vite.log
  3. At this point it got just "p" as the output and
{
  "exit_code": -1,
  "hostname": null,
  "pid": -1,
  "prefix": "",
  "py_interpreter_path": null,
  "suffix": "\n[The command has no new output after 30 seconds. You may wait longer to see additional output by sending empty command '', send other commands to interact with the current process, or send keys to interrupt/kill the command.]",
  "username": null,
  "working_dir": null
}

as the metadata.

This is unexpected, as I would have expected that the command that was run in the background would be in the background, and then the other commands would have executed quickly and returned a response.

The full trajectory can be found here: https://www.all-hands.dev/share?share_id=ca57575f8cd2c41652aaeca4e9613082e2591b0833e6a7f796f43f836932eb12

OpenHands Installation

app.all-hands.dev

OpenHands Version

0.22.0

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

neubig avatar Feb 04 '25 17:02 neubig

Again having trouble after "ctrl-c" is pressed. I wasn't able to press the "stop" button on the interface and the agent froze up.

Image

neubig avatar Feb 18 '25 02:02 neubig

Yeah this is a major issue. Going to bump up severity because it essentially locks the session and you can no longer run commands.

mamoodi avatar Feb 19 '25 20:02 mamoodi

Is this still an issue now?

xingyaoww avatar Mar 04 '25 20:03 xingyaoww

We still have C-c problems, but maybe this is not one of them. Let's close.

neubig avatar Mar 04 '25 21:03 neubig