fix: prevent repeated task creation after failures

This commit is contained in:
2026-05-06 15:49:18 +08:00
parent 9cc8055020
commit c7d972e5cd
6 changed files with 56 additions and 18 deletions

View File

@@ -18,8 +18,8 @@ def make_config(tmp_path: Path, **overrides: object) -> AppConfig:
"scheduler": {"interval_seconds": 1, "concurrency": 1, "lease_seconds": 60},
"workspace": {"root": tmp_path / "workspaces", "cleanup_on_success": False},
"agents": {
"implementer": {"command": ["implementer", "-"]},
"reviewer": {"command": ["reviewer", "-"]},
"implementer": {"command": ["implementer", "--cd", "{workspace_path}", "-"]},
"reviewer": {"command": ["reviewer", "--cd", "{workspace_path}", "-"]},
},
}
data.update(overrides)
@@ -208,6 +208,9 @@ def test_run_task_success_posts_review_comments(db, tmp_path):
assert task is not None
assert task.state == TaskState.HUMAN_REVIEW_READY
assert task.pr_number == 5
command = json.loads(db.list_agent_runs(task.id)[0]["command_json"])
assert command[1] == "--cd"
assert Path(command[2]).is_absolute()
assert [path for _, path, _ in requests].count("/api/v1/repos/acme/service/issues/5/comments") == 2