Skip to content
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]: Very longs commands execution in terminal on macos #6218

Open
1 task done
Proger666 opened this issue Jan 13, 2025 · 15 comments
Open
1 task done

[Bug]: Very longs commands execution in terminal on macos #6218

Proger666 opened this issue Jan 13, 2025 · 15 comments
Labels
bug Something isn't working

Comments

@Proger666
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

There is a significant delay in commands execution which are run in openhands terminal.
This leads to errors like this:
[The command timed out after 120 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.]
--END AGENT OBSERVATION--

Running commands directly via docker exec does not cause any delays and work normally.

Manual commands execution pose the same significant delays in commands execution.

OpenHands Installation

Docker command in README

OpenHands Version

0.19

Operating System

MacOS

Logs, Errors, Screenshots, and Additional Context

11:03:20 - ACTION
[Agent Controller 732999583fee427caaf06cf09e3b9196] CmdRunAction (source=EventSource.AGENT)
COMMAND:
y
11:05:20 - OBSERVATION
[Agent Controller 732999583fee427caaf06cf09e3b9196] CmdOutputObservation (source=EventSource.AGENT, exit code=-1, metadata={
"exit_code": -1,
"pid": -1,
"username": null,
"hostname": null,
"working_dir": null,
"py_interpreter_path": null,
"prefix": "[Command output continued from previous command]\n",
"suffix": "\n[The command timed out after 120 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.]"
})

--BEGIN AGENT OBSERVATION--
[Command output continued from previous command]

npx
create-vue my-todo-app

RangeError: Incorrect locale information provided

Vue.js - The Progressive JavaScript Framework

? Add TypeScript? › No / Yes
[The command timed out after 120 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.]
--END AGENT OBSERVATION--

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 13, 2025

I believe with the new changes, you can send Yes / No to the question for interactive prompts.
It says:
Add Typscript? No / Yes

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 13, 2025

Oh my apologies. In the new changes, this happens automatically. I just saw it happen in one of my runs. If you leave it running does it automatically send Yes to the terminal at all?

@Proger666
Copy link
Author

Proger666 commented Jan 13, 2025

Yes, eventually it will send "yes" but it's not effective due to terminal timeout

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 13, 2025

Hmmmm in my case it was able to continue but yours looks like it behaved differently?

@scosenza
Copy link

I also just noticed this error, and I'm also on mac.

I'm not sure if it's related to the OpenHands branch I'm in, but I noticed this while testing out #5284 using CLI mode:

...
poetry run ... openhands.core.cli ...
...
15:58:12 - openhands:DEBUG: stream.py:265 - Adding CmdRunAction id=21 from AGENT
15:58:12 - openhands:DEBUG: agent_controller.py:612
ACTION
[Agent Controller default] **CmdRunAction (source=EventSource.AGENT)**
THOUGHT: Now let's run the build and test script to ensure our changes compile and pass tests:
COMMAND:
tools/bazelCompileAndTest.sh
16:00:13 - openhands:DEBUG: stream.py:265 - Adding CmdOutputObservation id=22 from AGENT
16:00:13 - openhands:DEBUG: agent_controller.py:300
OBSERVATION
[Agent Controller default] **CmdOutputObservation (source=EventSource.AGENT, exit code=-1, metadata={
  "exit_code": -1,
  "pid": -1,
  "username": null,
  "hostname": null,
  "working_dir": null,
  "py_interpreter_path": null,
  "prefix": "",
  "suffix": "\n[The command timed out after 120 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.]"
})**
--BEGIN AGENT OBSERVATION--

[The command timed out after 120 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.]
--END AGENT OBSERVATION--
[Agent Controller default] LEVEL 0 LOCAL STEP 10 GLOBAL STEP 10
...
16:00:19 - openhands:DEBUG: stream.py:265 - Adding FileReadAction id=23 from AGENT
16:00:19 - openhands:DEBUG: agent_controller.py:612
ACTION
[Agent Controller default] FileReadAction(path='/workspace/projects/datascope/BUILD.bazel', start=0, end=-1, thought='I apologize, but it seems the bazelCompileAndTest.sh script is not available in this environment. Let me check if we need to update the BUILD.bazel file to include the Apache Commons dependency:', action='read', security_risk=None, impl_source=<FileReadSource.OH_ACI: 'oh_aci'>, translated_ipython_code="print(file_editor(**{'path': '/workspace/projects/datascope/BUILD.bazel', 'command': 'view'}))")
16:00:19 - openhands:DEBUG: stream.py:265 - Adding FileReadObservation id=24 from AGENT
...

@scosenza
Copy link

scosenza commented Jan 15, 2025

I also just noticed this in "headless" mode. Is this where to increase the timeout?

#timeout = 120

[The command timed out after 120 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.]

@enyst
Copy link
Collaborator

enyst commented Jan 15, 2025

I think that timeout is defined in config.toml, the [sandbox] section, as you pointed out above in the template. So you can increase there (in the config.toml) as you wish.

Or, if you run with docker run, then it can be sent via env, with the equivalent environment var SANDBOX_TIMEOUT

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 15, 2025

I think there may be a regression somewhere. Several people bringing up issues with running commands:
#6259

@amirshawn
Copy link

amirshawn commented Jan 15, 2025

@mamoodi I agree. This should be escalated! Things that used to take a second are taking minutes. Something simple like this Running a bash command
Command: cd /workspace && cat instructions/plan.md used to take a split second. Now it takes minutes. This is something new and should be addressed soon.

@amirshawn
Copy link

I've recently been using Docker run to start my session and that's where I've been having the problems. I switched to using make build and make run and it seems like it's not happening there. I hope that gives a clue to what's going on

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 15, 2025

Agreed @amirshawn . The team is looking into it actively right now.

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 15, 2025

Hey all I think we have some understanding on this now. For now you can use 0.18 version as that doesn't seem to have the issue.
Hoping to get a fix soon 🤞

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 16, 2025

Hey folks. There's been a PR with some potential fixes. Can you all try to see if you're still seeing the same issue very frequently please? And let me know when you run into it. Either by sharing logs or pressing the thumbs down and sharing the link if you can.

I've been testing it a bit. Using npm it struggles a bit but seems to recover better in some scenarios. I'll continue testing tomorrow as well.

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 22, 2025

There's been some improvements in this area in 0.21. However, don't believe it's 100% fixed. Let me know if you all are seeing better/worse/same results if you happen to see this.

@amirshawn
Copy link

@mamoodi I can confirm there's been huge improvement. Still no 100% but much much better. To me it seems like what seems to make it stall now is the error from anthropic about reaching it's minute token limit. It seems to make it stall and then it doesn't restart every time. If I respond ok, it gets it going again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants