π OpenHands: AI-Driven Development
Enable runtime image build for resolver's experimental feature (#5972)
Ryan H. Tran23f40a1c01ed
diff --git a/.github/workflows/openhands-resolver.yml b/.github/workflows/openhands-resolver.ymlindex 028316ee05..a9d90c38b1 100644--- a/.github/workflows/openhands-resolver.yml+++ b/.github/workflows/openhands-resolver.yml@@ -184,6 +184,7 @@ jobs:});- name: Install OpenHands+ id: install_openhandsuses: actions/github-script@v7env:COMMENT_BODY: ${{ github.event.comment.body || '' }}@@ -196,7 +197,6 @@ jobs:const reviewBody = process.env.REVIEW_BODY.trim();const labelName = process.env.LABEL_NAME.trim();const eventName = process.env.EVENT_NAME.trim();-// Check conditionsconst isExperimentalLabel = labelName === "fix-me-experimental";const isIssueCommentExperimental =@@ -205,6 +205,9 @@ jobs:const isReviewCommentExperimental =eventName === "pull_request_review" && reviewBody.includes("@openhands-agent-exp");+ // Set output variable+ core.setOutput('isExperimental', isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental);+// Perform package installationif (isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental) {console.log("Installing experimental OpenHands...");@@ -230,7 +233,8 @@ jobs:--issue-number ${{ env.ISSUE_NUMBER }} \--issue-type ${{ env.ISSUE_TYPE }} \--max-iterations ${{ env.MAX_ITERATIONS }} \- --comment-id ${{ env.COMMENT_ID }}+ --comment-id ${{ env.COMMENT_ID }} \+ --is-experimental ${{ steps.install_openhands.outputs.isExperimental }}- name: Check resolution resultid: check_resultdiff --git a/openhands/resolver/resolve_issue.py b/openhands/resolver/resolve_issue.pyindex 21036dbc29..f50b37d794 100644--- a/openhands/resolver/resolve_issue.py+++ b/openhands/resolver/resolve_issue.py@@ -14,12 +14,7 @@ from termcolor import coloredimport openhandsfrom openhands.controller.state.state import State-from openhands.core.config import (- AgentConfig,- AppConfig,- LLMConfig,- SandboxConfig,-)+from openhands.core.config import AgentConfig, AppConfig, LLMConfig, SandboxConfigfrom openhands.core.logger import openhands_logger as loggerfrom openhands.core.main import create_runtime, run_controllerfrom openhands.events.action import CmdRunAction, MessageAction@@ -153,7 +148,7 @@ async def process_issue(max_iterations: int,llm_config: LLMConfig,output_dir: str,- runtime_container_image: str,+ runtime_container_image: str | None,prompt_template: str,issue_handler: IssueHandlerInterface,repo_instruction: str | None = None,@@ -306,7 +301,7 @@ async def resolve_issue(max_iterations: int,output_dir: str,llm_config: LLMConfig,- runtime_container_image: str,+ runtime_container_image: str | None,prompt_template: str,issue_type: str,repo_instruction: str | None,@@ -583,11 +578,16 @@ def main():default=None,help="Target branch to pull and create PR against (for PRs). If not specified, uses the PR's base branch.",)+ parser.add_argument(+ '--is-experimental',+ type=lambda x: x.lower() == 'true',+ help='Whether to run in experimental mode.',+ )my_args = parser.parse_args()runtime_container_image = my_args.runtime_container_image- if runtime_container_image is None:+ if runtime_container_image is None and not my_args.is_experimental:runtime_container_image = (f'ghcr.io/all-hands-ai/runtime:{openhands.__version__}-nikolaik')