evals: add pi backend

This commit is contained in:
Jesse Vincent
2026-05-07 11:11:18 -07:00
parent 5ca4153994
commit 7d06d7e4f0
8 changed files with 214 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ from drill.normalizer import (
NORMALIZERS,
collect_new_logs,
filter_codex_logs_by_cwd,
filter_pi_logs_by_cwd,
snapshot_log_dir,
)
from drill.session import TmuxSession
@@ -348,6 +349,11 @@ class Engine:
# Project name is the workdir basename, lowercased
project = workdir.resolve().name.lower()
return Path.home() / ".gemini" / "tmp" / project
elif self.backend.family == "pi":
# Pi stores sessions under ~/.pi/agent/sessions/<encoded-cwd>/.
# Return the root and filter by the session header cwd because
# multiple evals may run concurrently under the same tree.
return Path.home() / ".pi" / "agent" / "sessions"
pattern = self.backend.session_logs.get("pattern", "")
if not pattern:
return None
@@ -363,6 +369,8 @@ class Engine:
new_files = collect_new_logs(log_dir, snapshot)
if self.backend.family == "codex":
new_files = filter_codex_logs_by_cwd(new_files, str(workdir.resolve()))
elif self.backend.family == "pi":
new_files = filter_pi_logs_by_cwd(new_files, str(workdir.resolve()))
normalizer = NORMALIZERS.get(self.backend.family)
if not normalizer:
return []