Repository navigation
fix(agent-evals): audit the branch a local session switched to - #4459
Conversation
286710b to
aebd64b
Compare
Agent evals❌ 2 failed · ✅ 17 passed ❌ Failed (2)
✅ Passed (17)
Audited 7c92a99. This check only reports. |
Agent evals
|
46aa494 to
a30325e
Compare
837024e to
bb1f260
Compare
Local sessions that start on one branch (e.g. `main`) and switch to another were audited on the start branch, which has none of their changes. The provider now takes the branch the session last switched to from the reflog of `HEAD`, and checks that it contains the session's start commit. Reports that audited no changes now warn about it, and are replaced by the workflow's audit of the diff. Also adds a PR description guideline to AGENTS.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bb1f260 to
7c92a99
Compare
…nt-evals-end-branch # Conflicts: # AGENTS.md Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Description
yarn eval:reportfor local sessions audited the wrong commit whenever a session started on one branch (typicallymain) and switched to its PR branch later. The provider only knew the branch fromsession.start, so it audited the start branch, which is still at the session's start commit, i.e. an empty diff. Every rule then passed with nothing to check, and the report warned that it hadn't audited the head of the PR (e.g. #4458 (comment) and the report on #4455, where the audited commit is exactly the PR commit's parent).This change:
HEAD: the lastcheckout: moving from … to …entry between the session's first and last event, under the name it was last renamed to (Branch: renamed …), falling back to the start branch. This works for any way of switching branches (git switch,checkout -b,gh pr checkout, an IDE) and doesn't depend on GitHub.Agent evalsworkflow replaces it with its own audit of the diff.yarn eval:report. Reports are now looked up by the account that posts them (gh api user), falling back to the PR author for tokens that cannot read/user, such asGITHUB_TOKEN.Alternatives considered:
HEAD: simplest, but auditing a session from another checkout (--var copilotSession=<id>,previous) would silently audit unrelated changes.gh pr create/create_pull_requestresults in the log): specific to GitHub, and misses sessions that switch branches without creating a PR.Known limitations:
HEADfails with "Branch '…' was not found". Both are unlikely for agent sessions.git worktree add) still audit an empty diff, but the new warning now flags it.Agent evalsworkflow only counts reports by itself and the PR author, so it doesn't see a user's report on an agent's PR and posts its own as well.Also adds guidelines to
AGENTS.mdfor writing PR descriptions and for verifying findings when reviewing PRs.The
performance-reportingrule now applies only to benchmarks and claims that code got faster or slower. It failed sessions that timed a regular expression only to check that it no longer backtracks.Test plan
yarn buildandyarn testinincubator/agent-evals: passed (140 tests)yarn buildandyarn testinevals: passed (37 tests)64b1994, then creates and commits on a new branch:yarn eval:reporton this PR, from a session that renamed its branch and whose PR is authored by Copilot: audits the head of the PR and edits the existing reportCoverage (lines / branches / functions):
agent-evals/src/provider/provider.tsagent-evals/src/provider/session.tsagent-evalstotalevals/src/report-comment.tsThe
agent-evalstotal dips becausereplay(), which runs git and had no tests before, gains code; the new reflog parsing is covered by unit tests.post-report.tshas no tests; it runsghand promptfoo.