Update agent-sdk version and import paths#26
Conversation
- Update agent-sdk SHA to latest commit (ab8980714dd397f26fe811227afbc533c59fae70) - Change subdirectory from openhands/core to openhands/sdk - Update import paths from openhands.core.* to openhands.sdk.* - Replace CodeActAgent with Agent class - Update lock file with new dependencies - All tests passing Fixes #25 Co-authored-by: openhands <openhands@all-hands.dev>
|
@OpenHands notice that the build and test binary logs are showing the error We should do the following
|
|
I'm on it! malhotra5 can track my progress at all-hands.dev 🔴 Solvability: HARD This is a complex build system issue involving PyInstaller binary packaging where a system prompt file cannot be found, requiring updates to build specifications and CI integration. The issue involves multiple interconnected components including the agent SDK, build configuration, and deployment pipeline, making it challenging to resolve. You can make the issue easier to resolve by addressing these concerns in the conversation: • Provide step-by-step instructions for reproducing the build failure locally to help developers test their fixes |
- Update PyInstaller spec to use new agent-sdk import paths (openhands.sdk instead of openhands.core) - Fix missing prompt file error by updating data collection paths - Improve error handling to return proper exit codes instead of exceptions - Update CI to properly test binary startup and catch errors - Add comprehensive binary testing for missing API keys and prompt files - Update tests to match new return code behavior Fixes the 'Prompt file system_prompt.j2 not found' error in binary builds.
|
I have successfully fixed the binary build error and implemented all requested improvements: ✅ Issues Resolved:
Verification Results:
The binary now starts cleanly and the CI will catch any similar issues automatically. Changes have been committed and pushed to PR #26. |
- Created AgentSetupError exception class with exit_code attribute - Modified setup_agent() to raise AgentSetupError instead of returning exit codes - Updated run_agent_chat() to catch AgentSetupError and return appropriate exit code - This allows GitHub CI to properly catch and handle setup failures Co-authored-by: openhands <openhands@all-hands.dev>
|
@OpenHands please rework the agent chat and CI we want to build and test the executable binary but we don't want to rely so heavily on returning exact exit codes in the program, it's very messy in the actual program, raise errors and exit the application normally in the CI, look for specific message outputs. Note that when the executable is running, it is long lived. It won't exit without an interrupt or |
|
I'm on it! malhotra5 can track my progress at all-hands.dev 🔴 Solvability: HARD This is a complex architectural refactoring request that involves reworking multiple system components including agent chat functionality, CI/CD pipeline, and executable binary testing strategies. The issue lacks concrete technical details, specific error scenarios, and clear implementation guidance, making it challenging to resolve without significant additional context. You can make the issue easier to resolve by addressing these concerns in the conversation: • Provide specific examples of the current "messy" exit code behavior and which exact exit codes are problematic |
- Remove exit code dependencies from agent_chat.py and simple_main.py - Functions now raise exceptions and exit normally with sys.exit() - Update CI to test message outputs for long-lived process behavior - Add comprehensive CI tests for interactive commands (/help, /status, /exit) - Update unit tests to expect SystemExit exceptions instead of return codes - Improve error handling to be more natural and maintainable Co-authored-by: openhands <openhands@all-hands.dev>
SummaryI have successfully reworked the agent chat and CI system as requested. Here's what was accomplished: ✅ Request Fulfillment Checklist:
Key Improvements:
Testing Results:
The changes have been committed and pushed to the |
- Remove complex error checking and multiple test jobs - Use single test job with LITELLM_API_KEY and LITELLM_MODEL already exported - Test /status, /help, and /exit commands in sequence - Simply display output without explicit validation checks - Cleaner and more maintainable CI approach Co-authored-by: openhands <openhands@all-hands.dev>
|
@OpenHands lets simplify the build and CI tests make sure that application starts, we can send the remove any other complexity in the testing phase |
|
I'm on it! malhotra5 can track my progress at all-hands.dev 🟡 Solvability: MEDIUM This is a medium-complexity task requesting simplification of build and CI testing processes with clear expectations for application startup and command verification. The issue benefits from straightforward language and well-defined success criteria, though it involves coordinating changes across multiple system components. You can make the issue easier to resolve by addressing these concerns in the conversation: • Provide more specific details about the current build and CI setup to better understand what complexity needs to be removed Positive feedback: • The request uses clear, simple language that makes the desired outcome easy to understand |
- Focus CI on core functionality: app startup and /help command - Remove complex exit code testing and error handling verification - Simplify build.py test_executable() to test /help command output - Update CI workflow to verify expected help output content - Maintain all existing functionality while reducing test complexity Co-authored-by: openhands <openhands@all-hands.dev>
SummaryI have successfully simplified the build and CI tests as requested. Here's what was accomplished: ✅ Request Fulfillment Checklist:
Key Changes Made:CI Workflow (
Build Script (
Verification:
The changes have been committed and pushed to the |
|
@OpenHands please clean up don't raise sys exists just let the application finish normally then chat that CI and build will still catch errors. To test this temporarily comment out the jinja file dependency in the Pyinstaller spec and see that CI still catches it |
|
I'm on it! malhotra5 can track my progress at all-hands.dev 🟡 Solvability: MEDIUM This is a well-defined code cleanup task with clear instructions to remove sys.exit calls from specific files and replace them with normal application termination. The request follows standard refactoring patterns and targets a localized change that doesn't require deep implementation knowledge. You can make the issue easier to resolve by addressing these concerns in the conversation: • Consider providing examples of the current sys.exit usage patterns to help identify all instances that need modification Positive feedback: • The task has a clear, isolated cause with specific files and changes identified |
…finish normally - Remove sys.exit() calls from agent_chat.py and simple_main.py - Replace with proper exception raising to let application finish normally - CI and build will still catch errors through output validation - Tested that CI still detects build/runtime errors without explicit exit codes Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
- Tests now expect original exceptions instead of SystemExit - ImportError and general exceptions are now raised directly - This aligns with the cleanup that removed sys.exit() calls Co-authored-by: openhands <openhands@all-hands.dev>
SummaryI have successfully cleaned up the error handling in ✅ Request Fulfillment Checklist:
Key Changes Made:In
In
In
Verification Results:
Key Insight:The application now finishes normally through Python's natural exception handling instead of using The changes have been pushed to the existing PR branch |
Summary
This PR updates the agent-sdk dependency to the latest version and fixes the import paths as requested in issue #25.
Changes Made
288e440b344c67c66e2093215521a1394b1509b6toab8980714dd397f26fe811227afbc533c59fae70(latest commit on main branch)openhands/coretoopenhands/sdkto match the new repository structurefrom openhands.core.*imports tofrom openhands.sdk.*CodeActAgentwithAgentclassuv.lockwith the new dependenciesTesting
Verification
The changes ensure compatibility with the latest agent-sdk version while maintaining all existing functionality. The import structure now matches the example provided in the agent-sdk repository.
Fixes #25
@malhotra5 can click here to continue refining the PR