π 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.ymlindex 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 artifactuses: actions/upload-artifact@v4with:diff --git a/openhands-cli/build.py b/openhands-cli/build.pyindex 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_DIRfrom 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 executableif 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)+