This commit is contained in:
@@ -13,11 +13,11 @@ class AiderAgent:
|
||||
def __init__(self, settings: Settings) -> None:
|
||||
self.settings = settings
|
||||
|
||||
def run(self, workspace: Path, task: str) -> str:
|
||||
def run(self, workspace: Path, task: str, files: tuple[str, ...] = ()) -> str:
|
||||
task_file = workspace / ".git" / "failure-task.txt"
|
||||
task_file.write_text(task)
|
||||
task_file.chmod(0o600)
|
||||
command = self.command(task_file)
|
||||
command = self.command(task_file, files)
|
||||
coder = pwd.getpwnam("coder")
|
||||
git_config = Path(coder.pw_dir) / ".gitconfig"
|
||||
git_config.write_text(
|
||||
@@ -66,8 +66,8 @@ class AiderAgent:
|
||||
raise RuntimeError(f"Aider failed ({result.returncode}): {result.stderr[-4000:]}")
|
||||
return result.stdout[-12_000:]
|
||||
|
||||
def command(self, task_file: Path) -> list[str]:
|
||||
return [
|
||||
def command(self, task_file: Path, files: tuple[str, ...] = ()) -> list[str]:
|
||||
command = [
|
||||
self.settings.agent_command,
|
||||
"--model",
|
||||
self.settings.agent_model,
|
||||
@@ -88,3 +88,7 @@ class AiderAgent:
|
||||
"--timeout",
|
||||
"180",
|
||||
]
|
||||
for filename in files:
|
||||
if (task_file.parent.parent / filename).is_file():
|
||||
command.extend(["--file", filename])
|
||||
return command
|
||||
|
||||
Reference in New Issue
Block a user