mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-08 22:38:05 -05:00
Enable runtime image build for resolver's experimental feature (#5972)
This commit is contained in:
8
.github/workflows/openhands-resolver.yml
vendored
8
.github/workflows/openhands-resolver.yml
vendored
@@ -184,6 +184,7 @@ jobs:
|
||||
});
|
||||
|
||||
- name: Install OpenHands
|
||||
id: install_openhands
|
||||
uses: actions/github-script@v7
|
||||
env:
|
||||
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 conditions
|
||||
const 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 installation
|
||||
if (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 result
|
||||
id: check_result
|
||||
|
||||
@@ -14,12 +14,7 @@ from termcolor import colored
|
||||
|
||||
import openhands
|
||||
from openhands.controller.state.state import State
|
||||
from openhands.core.config import (
|
||||
AgentConfig,
|
||||
AppConfig,
|
||||
LLMConfig,
|
||||
SandboxConfig,
|
||||
)
|
||||
from openhands.core.config import AgentConfig, AppConfig, LLMConfig, SandboxConfig
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.core.main import create_runtime, run_controller
|
||||
from 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'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user