Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable runtime image build for resolver's experimental feature #5972

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/openhands-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ jobs:
});

- name: Install OpenHands
id: install_openhands
uses: actions/github-script@v7
env:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems moving the env variables to echo statements causes a regression that #5641 and #5897 addressed; could we move them back to the original env statements?

Here is a sample test logs that showcase the failure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it back, can you have a look again?

COMMENT_BODY: ${{ github.event.comment.body || '' }}
Expand All @@ -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 =
Expand All @@ -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...");
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions openhands/resolver/resolve_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@

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
Expand Down Expand Up @@ -156,7 +151,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,
Expand Down Expand Up @@ -309,7 +304,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,
Expand Down Expand Up @@ -586,11 +581,16 @@ def int_or_none(value):
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'
)
Expand Down
Loading