Compare commits
3 Commits
d51070b535
...
9dfbc5efa4
Author | SHA1 | Date | |
---|---|---|---|
9dfbc5efa4 | |||
f28df768e7 | |||
d03a8aa9df |
|
@ -155,15 +155,16 @@ def create_aider_command(issue: str) -> list[str]:
|
|||
AIDER_LINT,
|
||||
'--auto-test',
|
||||
'--no-auto-lint',
|
||||
'--api-key',
|
||||
secrets.llm_api_key(),
|
||||
'--read',
|
||||
'CONVENTIONS.md',
|
||||
'--message',
|
||||
LLM_MESSAGE_FORMAT.format(issue=issue),
|
||||
'--yes-always',
|
||||
'--yes',
|
||||
]
|
||||
|
||||
for key in secrets.llm_api_keys():
|
||||
l += ['--api-key', key]
|
||||
|
||||
if True:
|
||||
l.append('--cache-prompts')
|
||||
|
||||
|
@ -282,6 +283,7 @@ def run_cmd(cmd: list[str], cwd: Path | None = None, check=True) -> bool:
|
|||
result = subprocess.run(cmd, check=check, cwd=cwd)
|
||||
return result.returncode == 0
|
||||
|
||||
SKIP_AIDER = False
|
||||
|
||||
def solve_issue_in_repository(
|
||||
args,
|
||||
|
@ -292,6 +294,8 @@ def solve_issue_in_repository(
|
|||
issue_number: str,
|
||||
gitea_client=None,
|
||||
) -> bool:
|
||||
logger.info("### %s #####", issue_title)
|
||||
|
||||
repo_url = f'{args.gitea_url}:{args.owner}/{args.repo}.git'.replace(
|
||||
'https://',
|
||||
'git@',
|
||||
|
@ -320,11 +324,15 @@ def solve_issue_in_repository(
|
|||
|
||||
# Run aider
|
||||
issue_content = f'# {issue_title}\n{issue_description}'
|
||||
succeeded = run_cmd(
|
||||
create_aider_command(issue_content),
|
||||
tmpdirname,
|
||||
check=False,
|
||||
)
|
||||
if not SKIP_AIDER:
|
||||
succeeded = run_cmd(
|
||||
create_aider_command(issue_content),
|
||||
tmpdirname,
|
||||
check=False,
|
||||
)
|
||||
else:
|
||||
logger.warning("Skipping aider command (for testing)")
|
||||
succeeded = True
|
||||
if not succeeded:
|
||||
logger.error('Aider invocation failed for issue #%s', issue_number)
|
||||
return False
|
||||
|
@ -344,7 +352,7 @@ def solve_issue_in_repository(
|
|||
)
|
||||
files_changed = result.stdout.strip()
|
||||
|
||||
if not files_changed:
|
||||
if not files_changed and not SKIP_AIDER:
|
||||
logger.info(
|
||||
'Aider did not make any changes beyond the initial ruff pass for issue #%s',
|
||||
issue_number,
|
||||
|
|
|
@ -163,7 +163,6 @@ class GiteaClient:
|
|||
'body': body,
|
||||
'head': head,
|
||||
'base': base,
|
||||
'labels': labels,
|
||||
}
|
||||
|
||||
response = self.session.post(url, json=json_data)
|
||||
|
|
|
@ -3,9 +3,9 @@ import secret_loader
|
|||
SECRETS = secret_loader.SecretLoader()
|
||||
|
||||
|
||||
def llm_api_key():
|
||||
return SECRETS.load_or_fail('LLM_API_KEY')
|
||||
def llm_api_keys() -> list[str]:
|
||||
return SECRETS.load_or_fail('LLM_API_KEY').strip().split('\n')
|
||||
|
||||
|
||||
def gitea_token():
|
||||
def gitea_token() -> str:
|
||||
return SECRETS.load_or_fail('GITEA_TOKEN')
|
||||
|
|
Loading…
Reference in New Issue
Block a user