Repository navigation
fix(agent): count a trimmed rerun of the same test command as the rerun - #7319
Conversation
After fixing a failing test, an answer that said "All 5 tests pass now" still ended "I haven't confirmed this works - 1 of 2 pytest runs didn't pass", because the passing rerun cut its output with "| tail -20" where the failing run used "| tail -40". Now the rerun replaces the earlier run and no note is added. A check is grouped by its command, so the two commands were two checks and the pre-fix failure was never superseded. The command's trailing output trimming (tail, head, tee, Select-Object -First/-Last, Out-String, redirections such as 2>&1 and > file) no longer counts toward which check it is; anything that changes what runs still does. Closes #ISSUE
|
Verdict: Approve with suggestions When the agent fixes a failing test and reruns it, the closing note no longer says "1 of 2 pytest runs didn't pass" just because the rerun cut its output differently (for example One small edge to tighten: a Real-world evidenceN/A: no evidence bundle was produced for this run. The change is in the agent's internal verification bookkeeping, and the PR's own test plan still has the in-app replay unchecked (the PR says it stays a draft until then). This verdict rests on static review and the PR's unit tests. I couldn't run the tests here because the runner has no 🔍 Technical detailsIssues 🟢
Real redirects are almost always preceded by a space, so requiring one closes most of this: ( Checked, no issue
Strengths
|
A passing "pytest ... | tail -20" still did not replace the failing "pytest ... | tail -40" before it, so a fixed test kept the closing note "1 of 2 pytest runs didn't pass". Now it does, for commands run through the shell tool. The shell tool declares its own check, and that check's target was the raw command, so the earlier fix (which only normalised the fallback for tools that declare nothing) never ran for it. Both paths now share one command_check_target(). A new test runs real pytest through run_shell_command twice and reads the resulting note.
A ">" inside a quoted argument, as in python -c "assert f()>0", was read as a redirect, so two different checks could share one target and a later pass of one would hide a failure of the other. A redirect now needs the space before it that real ones carry. Adds the quoted cases and a trimmed rerun that still fails, which must stay unverified.
…o kalin/rc18-verification-rerun-r2 # Conflicts: # src/gaia/agents/base/verification.py
|
Round 2 of the rc18 test still saw "1 of 2 pytest runs didn't pass" after a fixed test, when the two runs went through the shell tool with 🔍 Technical details
|
|
Took the review's quoted-`>` point: two different `python -c` checks no longer collapse into one, so a later pass of one can't hide a failure of the other. 🔍 Technical details
|
amd#7276, amd#7277, amd#7278, amd#7248, amd#7319 and amd#7322 merged, so their seven strict expected failures now pass and would turn the unit job red. The two left (amd#7321 open, amd#7326 unfixed) still fail as recorded. The stand-in console now returns an empty-string default the way the real transport does, instead of reading it as no default.
The rc18 release test found seven cases where GAIA's own answer checks got a turn wrong: a correct read-only answer ended with "I couldn't confirm all of this", a plan the user asked for was thrown away, an unanswered question became the user's answer. Each check had unit tests and none caught these, because every case needed the request, the tool results and the answer together. This adds a corpus of recorded turns and one test that replays each through the real loop with no model, so a misfire seen once in a release test becomes a file that guards it for good. Seeded with 16 turns: a "must not fire" and a "must fire" case for each of F8, F10, F11, F12, F36, F80 and F81. Adding a case is adding a JSON file; the README beside the cases says how to make one from a transcript. **Bugs it found** (a bug still open is a strict expected failure, so the fix has to delete the marker): | Case | Issue | Fix | |---|---|---| | Read-only answer that says "I wrote no file" gets the unsaved-file note | amd#7178 | amd#7276 (merged, marker removed) | | Answer quoting an edit's own backup path gets the note | amd#7179 | amd#7277 (merged, marker removed) | | A plan the user asked for is sent back as unfinished work | amd#7180 | amd#7278 (merged, marker removed) | | "Do NOT run anything" is answered with GAIA's own "look first" message | amd#7181 | amd#7278 (merged, marker removed) | | A native tool call is shown as answer text | amd#7205 | amd#7248 (merged, marker removed) | | A fixed test's rerun with a different `tail` reads as an unpassed check | amd#7293 | amd#7319 (merged, marker removed) | | A file a script wrote beside its input is called unwritten | amd#7293 | amd#7321 (merged, marker removed) | | Silence after a question is handed to the model as the user's answer | amd#7294 | amd#7322 (merged, marker removed) | | **New:** "I also saved it to X" with no write gets no note | amd#7326 | none yet | I replayed the corpus on each fix branch: every case passes there, so the markers come off as those PRs land. ## Test plan - [ ] `python -m pytest tests/unit/agents/test_answer_check_corpus.py -q` reports 17 passed, 1 xfailed - [ ] Delete the `"xfail"` line from any case and the test fails with the note or nudge the tester saw - [ ] Runs in the existing unit job (`test_unit.yml` runs `tests/unit/`), no workflow change needed <details> <summary>🔍 Technical details</summary> - `kind: "turn"` builds a bare `Agent` whose tools are stand-ins returning the recorded results (and writing the files the real call wrote, since the checks stat the disk), scripts the model's replies, and runs `process_query`. - `kind: "stream"` feeds recorded provider chunks to `AgentSDK.send_messages_stream` (F36 lives below the loop). - `kind: "question"` calls the flagship's real `request_user_input` with a console that answers or stays silent (F81 is the tool's contract, not a check). - Unknown keys in a case are an error, so a typo cannot turn an assertion off. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
After fixing a failing test, an answer that said "All 5 tests pass now"
still ended "I haven't confirmed this works - 1 of 2 pytest runs didn't
pass", because the passing rerun cut its output with "| tail -20" where the
failing run used "| tail -40". Now the rerun replaces the earlier run and
no note is added.
Refs #7293
Draft until it is replayed in the app: this changes a check or tool result the agent reads.
Test plan
python -m pytest tests/unit/agents/test_verification_scope.py(214 pass; 7 new tests fail on main)