OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Runtime Status Fixes

Open tofarr opened this issue 6 months ago • 1 comments

  • [ ] This change is worth documenting at https://docs.all-hands.dev/
  • [x] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality this introduces.

  • RuntimeStatus is now an enum rather than a string
  • RuntimeStatus is now included in the conversation info returned to the client
  • Client now determines whether to open the websocket based on the runtime status - so it is opened while the runtime is still starting and will display events like "Container started." and "Setting up git hooks..."

Summarize what the PR does, explaining any non-trivial design decisions.

This PR adds a new RuntimeStatus enum that defines various states a runtime can be in during its lifecycle (STOPPED, STARTING_RUNTIME, STARTING_CONTAINER, etc.). It updates the ConversationInfo model to include this runtime_status field and modifies all runtime implementations to use these standardized statuses.

On the frontend side, the agent status bar has been updated to display these detailed runtime statuses, providing users with more transparency about what is happening behind the scenes when a conversation is starting up or running.

The implementation includes:

  1. A new RuntimeStatus enum in openhands/runtime/runtime_status.py
  2. Updates to the ConversationInfo model to include runtime_status
  3. Modifications to all runtime implementations to use the new status enum
  4. Frontend updates to display the status messages in the agent status bar

This also fixes the stack trace in main when starting conversations:

Traceback (most recent call last):
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    yield
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 250, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
    raise exc from None
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
    raise exc
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 78, in handle_request
    stream = self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 124, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 207, in connect_tcp
    with map_exceptions(exc_map):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 155, in __exit__
    self.gen.throw(value)
  File "/Users/tofarr/dev/all-hands/OpenHands/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 61] Connection refused

Link of any specific issues this addresses:


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:5f382d3-nikolaik   --name openhands-app-5f382d3   docker.all-hands.dev/all-hands-ai/openhands:5f382d3

tofarr avatar Jun 10 '25 18:06 tofarr

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Lint
    • Run Frontend Unit Tests

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #9050

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

openhands-ai[bot] avatar Jun 11 '25 04:06 openhands-ai[bot]