V1 Integration (#11183)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
This commit is contained in:
Tim O'Farrell
2025-10-13 20:16:44 -06:00
committed by GitHub
parent 5076f21e86
commit f292f3a84d
115 changed files with 13086 additions and 264 deletions

View File

@@ -571,7 +571,7 @@ class IssueResolver:
# checkout the repo
repo_dir = os.path.join(self.output_dir, 'repo')
if not os.path.exists(repo_dir):
checkout_output = subprocess.check_output( # noqa: ASYNC101
checkout_output = subprocess.check_output(
[
'git',
'clone',
@@ -584,7 +584,7 @@ class IssueResolver:
# get the commit id of current repo for reproducibility
base_commit = (
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir) # noqa: ASYNC101
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir)
.decode('utf-8')
.strip()
)
@@ -596,7 +596,7 @@ class IssueResolver:
repo_dir, '.openhands_instructions'
)
if os.path.exists(openhands_instructions_path):
with open(openhands_instructions_path, 'r') as f: # noqa: ASYNC101
with open(openhands_instructions_path, 'r') as f:
self.repo_instruction = f.read()
# OUTPUT FILE
@@ -605,7 +605,7 @@ class IssueResolver:
# Check if this issue was already processed
if os.path.exists(output_file):
with open(output_file, 'r') as f: # noqa: ASYNC101
with open(output_file, 'r') as f:
for line in f:
data = ResolverOutput.model_validate_json(line)
if data.issue.number == self.issue_number:
@@ -614,7 +614,7 @@ class IssueResolver:
)
return
output_fp = open(output_file, 'a') # noqa: ASYNC101
output_fp = open(output_file, 'a')
logger.info(
f'Resolving issue {self.issue_number} with Agent {AGENT_CLASS}, model {model_name}, max iterations {self.max_iterations}.'
@@ -633,20 +633,20 @@ class IssueResolver:
# Fetch the branch first to ensure it exists locally
fetch_cmd = ['git', 'fetch', 'origin', branch_to_use]
subprocess.check_output( # noqa: ASYNC101
subprocess.check_output(
fetch_cmd,
cwd=repo_dir,
)
# Checkout the branch
checkout_cmd = ['git', 'checkout', branch_to_use]
subprocess.check_output( # noqa: ASYNC101
subprocess.check_output(
checkout_cmd,
cwd=repo_dir,
)
base_commit = (
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir) # noqa: ASYNC101
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir)
.decode('utf-8')
.strip()
)