-
Notifications
You must be signed in to change notification settings - Fork 102
More efficient websocket based implementation for async bash execution #1587
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
Conversation
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like 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>
Coverage Report •
|
||||||||||||||||||||||||||||||||||||||||
- 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>
h-openhands
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙏
hieptl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙏
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:

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

Checklist
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:1023802-pythonRun
All tags pushed for this build
About Multi-Architecture Support
1023802-python) is a multi-arch manifest supporting both amd64 and arm641023802-python-amd64) are also available if needed