Repository navigation
fix(agent): stop calling a saved script output or an input file unwritten - #7321
Conversation
…tten
Two closing "I couldn't confirm all of this" lines were wrong. A
recon_tables.xlsx a script wrote beside the named input was reported as
"No successful write ... is recorded", and after a denied save the line
named the input spreadsheet the answer said it had read from. Now the
script's output is found where it landed, and "what I would have written,
read from x.xlsx" is not taken as a claim that x.xlsx was written.
A bare output name ("also make recon_tables.xlsx") was only looked for in
the agent's working directory; it is now also looked for, by the same
modified-during-a-successful-run evidence, in the folders of the paths the
request named and of the files the turn wrote. A "would/could have
written" clause is dropped before a sentence is checked for save claims.
Closes #ISSUE
|
Verdict: Approve with suggestions This fixes two wrong "I couldn't confirm this was saved" warnings. One fired when a script saved its output next to the input file the user named. The other named an input file after a denied save, because the answer said "what I would have written, from x.xlsx". Both fixes are narrow and come with tests on each side: a file that existed before the turn, or sits in a folder nobody named, is still reported missing. The "would have written" check has two small gaps worth closing before merge:
Real-world evidenceN/A: no evidence bundle was produced for this run. This is an internal answer check with no CLI, API or UI surface to exercise here, so the verdict rests on static review and the PR's unit tests. The PR is a draft until the in-app replay in its Test plan is done. The gaia_files, gaia_data and gaia_honesty eval categories it lists are the right ones to watch on the next RC. 🔍 Technical detailsIssues 🟡 I checked both against the regex:
With the change below, the outputs become It's worth adding both sentences to the parametrized 🟢 Checked, no issue:
Strengths
|
"I would have written it to a.txt but I saved it to b.txt" dropped the
b.txt save along with the counterfactual clause, so a false claim about
b.txt went unchecked. The clause now stops at "but", and a typographic
apostrophe ("I’d have saved") is recognised like a straight one.
|
Fixed both gaps the review found in the "would have written" check. A real save after "but" is checked again, and "I’d have saved" with a curly apostrophe is recognised. 🔍 Technical details
|
test_a_bare_output_no_run_wrote_is_still_missing failed on Windows CI: the file written just before the run could carry an mtime inside the run's window, so it read as this turn's write. Stamping it an hour back makes it unambiguously older than the turn.
|
Not merged yet: the "would have written" strip still hides a real save that follows in the same clause. On a read-only question these fabricated saves are no longer flagged, though main flags them:
Next step: end the counterfactual clause at a second write verb (or at 🔍 Technical details
|
The hypothetical-save strip ran to the next comma, semicolon or "but",
so "I would have written it to a.txt and then saved a copy to b.txt"
dropped the real b.txt save with it and a made-up save went unchecked
on a read-only turn. The strip now also stops at a conjunction, a dash
or the next write verb, takes its own ";" or dash with it, and gives a
joined save ("... and then saved b.txt") its subject back.
# Conflicts: # tests/unit/agents/test_completion_evidence.py
|
All three fabricated saves from the verifier's list are flagged again on a read-only turn. The "would have written" strip now stops at the next save, so only the hypothetical part is dropped. The rc18 case it was added for ("what I would have written, from x.xlsx") still names no file. 🔍 Technical details
|
# Conflicts: # tests/unit/agents/test_completion_evidence.py
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]>
amd#7540) A made-up save that follows a "would have" clause with "but" goes unchecked. "I would have written it to a.txt, but saved the totals to `b.txt`" was flagged for `b.txt` before amd#7321 and is silent after it, on both read-only turns and turns that asked for a save. This restores the `b.txt` check while still dropping the hypothetical `a.txt`. Post-merge review finding on amd#7321: its fix gave a joined save its subject back after "and/so/then/instead", but not after ", but". ## Test plan - [x] `python -m pytest tests/unit/agents/test_completion_evidence.py -k would_have`: 4 new cases fail on main, pass here - [x] `python -m pytest -n 4 tests/unit/agents -k "save or completion or claim or refused or look or announced or grounding"`: 2144 passed - [ ] Eval categories to watch on the next RC: gaia_files, gaia_honesty <details> <summary>🔍 Technical details</summary> - `_COUNTERFACTUAL`'s `join` group now takes an optional leading comma and `but`/`yet`, so `_drop_counterfactual` turns ", but saved b.txt" into "I saved b.txt". </details>
Two closing "I couldn't confirm all of this" lines were wrong. A
recon_tables.xlsx a script wrote beside the named input was reported as
"No successful write ... is recorded", and after a denied save the line
named the input spreadsheet the answer said it had read from. Now the
script's output is found where it landed, and "what I would have written,
read from x.xlsx" is not taken as a claim that x.xlsx was written.
Refs #7293
Draft until it is replayed in the app: this changes a check or tool result the agent reads.
Test plan