fix: feed Codex prompts through stdin

This commit is contained in:
2026-05-06 15:47:15 +08:00
parent 631dc2ce3d
commit 9cc8055020
6 changed files with 14 additions and 17 deletions

View File

@@ -7,8 +7,8 @@ from .models import AgentResult
class CommandRunner:
def run(self, command: list[str], cwd: str | Path) -> AgentResult:
result = subprocess.run(command, cwd=cwd, text=True, capture_output=True, check=False)
def run(self, command: list[str], cwd: str | Path, *, stdin: str | None = None) -> AgentResult:
result = subprocess.run(command, cwd=cwd, input=stdin, text=True, capture_output=True, check=False)
return AgentResult(exit_code=result.returncode, stdout=result.stdout, stderr=result.stderr)

View File

@@ -201,7 +201,7 @@ class TaskRunner:
issue_title=issue.title,
branch_name=branch_name,
)
result = self.command_runner.run(command, workspace)
result = self.command_runner.run(command, workspace, stdin=prompt)
report = read_report(workspace / "AGENT_IMPLEMENTATION_REPORT.md")
self.db.add_agent_run(
task_id=task.id,
@@ -236,7 +236,7 @@ class TaskRunner:
issue_title=issue.title,
pr_number=pr_number,
)
result = self.command_runner.run(command, workspace)
result = self.command_runner.run(command, workspace, stdin=prompt)
report = read_report(workspace / "AGENT_REVIEW_REPORT.md")
self.db.add_agent_run(
task_id=task.id,