Skip to content

πŸ™Œ OpenHands: AI-Driven Development

CLI: fix binary build (#11591)

Rohit Malhotra231019974ce9
diff --git a/.github/workflows/cli-build-binary-and-optionally-release.yml b/.github/workflows/cli-build-binary-and-optionally-release.yml
index 6c319bb67f..0aefcd3820 100644
--- a/.github/workflows/cli-build-binary-and-optionally-release.yml
+++ b/.github/workflows/cli-build-binary-and-optionally-release.yml
@@ -71,6 +71,14 @@ jobs:
echo "βœ… Build & test finished without ❌ markers"
+ - name: Verify binary files exist
+ run: |
+ if ! ls openhands-cli/dist/openhands* 1> /dev/null 2>&1; then
+ echo "❌ No binaries found to upload!"
+ exit 1
+ fi
+ echo "βœ… Found binaries to upload."
+
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
diff --git a/openhands-cli/build.py b/openhands-cli/build.py
index 3b85de946a..715513a748 100755
--- a/openhands-cli/build.py
+++ b/openhands-cli/build.py
@@ -20,15 +20,6 @@ from openhands_cli.locations import AGENT_SETTINGS_PATH, PERSISTENCE_DIR
from openhands.sdk import LLM
-dummy_agent = get_default_cli_agent(
- llm=LLM(
- model='dummy-model',
- api_key='dummy-key',
- metadata=get_llm_metadata(model_name='dummy-model', llm_type='openhands'),
- ),
- cli_mode=True,
-)
-
# =================================================
# SECTION: Build Binary
# =================================================
@@ -126,7 +117,7 @@ def _is_welcome(line: str) -> bool:
return any(marker in s for marker in WELCOME_MARKERS)
-def test_executable() -> bool:
+def test_executable(dummy_agent) -> bool:
"""Test the built executable, measuring boot time and total test time."""
print('πŸ§ͺ Testing the built executable...')
@@ -274,7 +265,14 @@ def main() -> int:
# Test the executable
if not args.no_test:
- if not test_executable():
+ dummy_agent = get_default_cli_agent(
+ llm=LLM(
+ model='dummy-model',
+ api_key='dummy-key',
+ metadata=get_llm_metadata(model_name='dummy-model', llm_type='openhands'),
+ )
+ )
+ if not test_executable(dummy_agent):
print('❌ Executable test failed, build process failed')
return 1
@@ -285,4 +283,10 @@ def main() -> int:
if __name__ == '__main__':
- sys.exit(main())
+ try:
+ sys.exit(main())
+ except Exception as e:
+ print(e)
+ print('❌ Executable test failed')
+ sys.exit(1)
+