Repository navigation
fix(agent): read jest, vitest, mocha, go and cargo test summaries as checks - #4387
Conversation
…checks A JavaScript, Go or Rust project's test run was invisible to the verification record: the command was recognised as a check, but its output was only ever read for a pytest or unittest summary, so a failing `npm test | tail` or `go test ./...` behind a pipe passed on exit code alone, and a passing one still drew the "verify your change" reminder and left the eval judge unable to count it. One runner table in checks.py now knows each runner's own summary line, and verification.py and the flagship eval's tests_verified read through it instead of keeping their own pytest-only copies. go test and cargo test report per package or target, so any failing line there decides the run.
|
Verdict: Request changes This PR lets the agent read the test summaries that JavaScript, Go and Rust test runners print, so failing runs behind a pipe now count as failures. The design is good: one shared table replaces three copies of the pytest/unittest logic. One pattern is too loose, though. The new
Real-world evidenceN/A: no evidence bundle was produced for this run, and the change is internal verification/eval logic with no CLI, API, MCP or UI surface of its own. The verdict rests on static review, plus the false-positive cases I ran directly against the patched 🔍 Technical details🟡 The duration / These results feed Please add 🟢 Aliased import (src/gaia/agents/base/verification.py): Strengths
|
A snippet that printed `ok done` or `ok 200` was recorded as a passing `go test` run: it cleared the "verify your change" reminder and made the flagship eval's `tests_verified` true with no tests run. The duration, `(cached)` or `[...]` trailer go always writes after the package name is now required, so only a real package line matches. Also drops a walrus name that shadowed the summary variable in check_from_command, which mypy read as a type conflict.
|
Closed the loose 🔍 Technical details
|
A JavaScript, Go or Rust project's test run was invisible to the agent's verification record:
npm test,go test ./...andcargo testwere recognised as checks, but their output was only ever read for a pytest or unittest summary. A failing run behind a pipe (npm test | tail) passed on exit code alone, a passing run still drew the "verify your change" reminder, and the flagship eval's judge could not count it as a verified test run. One runner table now knows each runner's own summary line, and the verification footer, the answer seam, and the eval consumer all read through it; pytest and unittest behave exactly as before.Test plan
python -m pytest tests/unit/agents/test_unsupported_test_claim.py tests/unit/agents/test_answer_quality_checks.py tests/unit/agents/test_verification_scope.py tests/unit/eval/test_flagship_tasks.py -q— per-runner pass/fail cases for pytest, unittest, jest, vitest, mocha,go test,cargo test; a piped failure fails; a coloured vitest summary reads;[no tests to run]and--collect-onlydo not countpython -m pytest tests/unit/agents tests/unit/eval -q(2346 passed locally)python util/lint.py --black --isort --pylint🔍 Technical details
checks.py:_RUNNERStable (label, summary regex, ran regex,per_target);runner_summarypicks the summary printed last across runners, ANSI-stripped; forgo test/cargo testany failing package or target line decides the run._REPORTED_FAILURE_REgainsN failing,^FAIL,test result: FAILED.verification.py:summary_reports_failureandhas_test_run_summarynow go throughrunner_summaryinstead of a duplicated pytest/unittest pair of regexes (removed).flagship_tasks.py:_test_run_passeduses the shared table;tests_verifiedaccepts any test-kind check label instead of only"pytest".docs/sdk/core/agent-system.mdx: the fallback-classification sentence names the runners.