From 615af9b53d1d1abeb8c49ee9da12a13338ad2cf8 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Fri, 13 Mar 2026 17:32:07 +0000 Subject: [PATCH] leo: prioritize fresh PRs over re-evals in eval queue Unevaluated PRs (eval_attempts=0) now sort before re-evals in the eval cycle query. Fresh PRs have a higher chance of passing (~12%) vs re-evals of already-rejected PRs. Prevents migration-reset PRs from consuming eval slots that fresh PRs could use. Pentagon-Agent: Leo <294C3CA1-0205-4668-82FA-B984D54F48AD> --- lib/evaluate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/evaluate.py b/lib/evaluate.py index 8bce433..da862f2 100644 --- a/lib/evaluate.py +++ b/lib/evaluate.py @@ -520,6 +520,8 @@ async def evaluate_cycle(conn, max_workers=None) -> tuple[int, int]: AND (p.last_attempt IS NULL OR p.last_attempt < datetime('now', '-10 minutes')) ORDER BY + -- Fresh PRs before re-evals: unevaluated PRs have higher chance of passing + CASE WHEN COALESCE(p.eval_attempts, 0) = 0 THEN 0 ELSE 1 END, CASE COALESCE(p.priority, s.priority, 'medium') WHEN 'critical' THEN 0 WHEN 'high' THEN 1