Skip to content

Conversation

@tofarr
Copy link
Collaborator

@tofarr tofarr commented Jan 4, 2026

Summary

Currently when starting a Sandbox in the App Server we execute a number of bash commands related to git - Cloning repositories and running setup scripts. This means we get a lot of noise in the Agent Server as the app server polls it to determine whether these commands have completed:
image

Instead of polling, lets just use the websocket implementation instead:
image

Checklist

  • If the PR is changing/adding functionality, are there tests to reflect this?
  • If there is an example, have you run the example to make sure that it works?
  • If there are instructions on how to run the code, have you followed the instructions and made sure that it works?
  • If the feature is significant enough to require documentation, is there a PR open on the OpenHands/docs repository with the same branch name?
  • Is the github CI passing?

Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:1023802-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-1023802-python \
  ghcr.io/openhands/agent-server:1023802-python

All tags pushed for this build

ghcr.io/openhands/agent-server:1023802-golang-amd64
ghcr.io/openhands/agent-server:1023802-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:1023802-golang-arm64
ghcr.io/openhands/agent-server:1023802-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:1023802-java-amd64
ghcr.io/openhands/agent-server:1023802-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:1023802-java-arm64
ghcr.io/openhands/agent-server:1023802-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:1023802-python-amd64
ghcr.io/openhands/agent-server:1023802-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:1023802-python-arm64
ghcr.io/openhands/agent-server:1023802-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:1023802-golang
ghcr.io/openhands/agent-server:1023802-java
ghcr.io/openhands/agent-server:1023802-python

About Multi-Architecture Support

  • Each variant tag (e.g., 1023802-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 1023802-python-amd64) are also available if needed

@openhands-ai
Copy link

openhands-ai bot commented Jan 4, 2026

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

  • GitHub Actions are failing:
    • Run tests

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

@OpenHands please fix the failing actions on PR #1587 at branch `efficient-async`

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

You can manage your notification settings

Update unit tests to work with the new websocket-based execute_command:
- test_async_execute_command: Mock _execute_command instead of _execute
- test_async_execute_command_with_path_objects: Mock _execute_command
- test_async_concurrent_operations: Mock both _execute_command and _execute

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-agent-server/openhands/agent_server
   sockets.py994950%50–51, 57–59, 68–70, 76–78, 83–84, 86–87, 101–102, 104–105, 107–109, 112, 114–117, 119–120, 122–126, 128–131, 133–134, 137, 144–145, 159–163, 173
openhands-sdk/openhands/sdk/utils
   models.py1374765%42–43, 49, 51, 59–63, 86, 92, 134–136, 139, 142, 146, 156, 213, 219–222, 224–225, 228, 231–235, 238–242, 244, 266, 279–280, 282–284, 286, 290, 292, 296
openhands-sdk/openhands/sdk/workspace/remote
   async_remote_workspace.py866326%27–32, 36–37, 43–44, 47–48, 51–57, 78–79, 82–84, 99–102, 106–125, 128–129, 131, 155–157, 175–177, 191–193, 207–209
TOTAL14547691352% 

openhands-agent and others added 5 commits January 4, 2026 15:40
- Update test_async_execute_command to mock websocket objects instead of
  _execute_command, properly testing the websocket protocol
- Update test_async_execute_command_with_path_objects to test Path
  handling with websocket mocks
- Fix bug in _execute_command where Path objects weren't converted to
  strings before JSON serialization

Co-authored-by: openhands <openhands@all-hands.dev>
- Convert http:// to ws:// and https:// to wss:// in _execute_command
- Update tests to verify correct websocket URL scheme conversion

Co-authored-by: openhands <openhands@all-hands.dev>
@tofarr tofarr marked this pull request as ready for review January 4, 2026 16:51
Copy link

@h-openhands h-openhands left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🙏

Copy link
Contributor

@hieptl hieptl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🙏

@tofarr tofarr merged commit 4201393 into main Jan 4, 2026
21 checks passed
@tofarr tofarr deleted the efficient-async branch January 4, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants