Repository navigation
fix(agent): don't read "I wrote no file" as a claim that one was saved - #7276
Conversation
Before: an answer to a read-only question that said "I wrote no file this
turn" or "No file was written" was read as a claim that a file had been
saved, so GAIA re-prompted the model and ended the answer with "The
requested output file has no recorded successful write". After: a write
verb whose own subject or object is "no file", "nothing" or "none" is not
a claim, and the answer goes out as written.
A turn whose request asked for a save still counts that sentence, because
it names the save that is still owed; a negation elsewhere in the sentence
("No problem, I saved it to x.md") never cancels a real claim.
Closes #ISSUE
…mory
Before: a stored memory or recalled procedure that mentioned saving a file
("then save the chart to chart.png") made every later turn that recalled it
owe that save, so a plain question ended with "No successful write to
chart.png is recorded for this turn". After: only what the user typed this
turn can ask for a save.
The completion ledger read the memory-framed message; it now reads the
user's own text, the same source the grounding and look-first checks
already use.
Closes #ISSUE
The completion ledger takes any one-argument claim test, and tests pass their own. Asking it to forward a keyword broke those callers, so the agent now picks the claim test for the turn: one that still counts "no file was written" when the user asked for a save, the plain one otherwise. Closes #ISSUE
|
Verdict: Approve with suggestions A read-only answer that said "I wrote no file" got flagged as an unfinished save, and a recalled memory that mentioned a save made later turns owe one too. This PR fixes both. When the user did ask for a save, the check still demands it. The logic is sound and well tested, and no other caller of the save-claim check was missed.
Real-world evidenceN/A: no evidence bundle was produced for this run. The change is in the agent's turn-completion check, so it can only really be exercised with a live model. That falls to the author's pending replay and the next RC's eval (gaia_honesty, gaia_files, gaia_rag, gaia_memory, gaia_data, gaia_resilience). This verdict rests on static review alone. The unit tests couldn't be run on this runner either (pytest and dotenv aren't installed), so I relied on the PR's stated results. 🔍 Technical detailsIssues 🟢 A denial with an exception clause hides a real save ( Add the two sentences above to 🟡 Merge gate: the live replay is still unchecked. The PR is already marked draft until it runs. Please paste the replay's request and final answer into the PR when it's done. Checked, no action needed
Strengths
|
A read-only answer with the aside "... the `granite-1812` I have stored as your bookshelf slot - the file's line says `copper-1397`" was sent back with "The requested output file has no recorded successful write", and the model dropped the useful aside. It is now left alone. A sentence counted as a save claim whenever it held a write verb and any file word. A write verb that tells of something remembered no longer counts: "stored as your ...", "saved to memory", or a backticked value that is not a path right before "I have stored". "I saved report.md", "saved as chart.png" and "the `report.md` I saved" are still claims.
"I created no other files besides notes.md" and "I saved nothing but the report to r.md" read as denials, so a made-up save worded that way went unchecked on a turn that did not ask for one. A negation followed by an exception (but, except, besides, other than, apart from) now still claims the file it names.
…o kalin/rc18-negated-save-claim-r2 # Conflicts: # src/gaia/agents/base/agent.py # tests/unit/agents/test_fabricated_save_guard.py
|
Round 2 of the rc18 test found the same false re-prompt from a sentence that is not negated: a read-only answer with the aside "... the "I saved report.md", "saved as chart.png" and "the 🔍 Technical details
|
|
Closed the exception-clause gap the review found. "I created no other files besides 🔍 Technical details
|
The remembered-value carve-out also dropped real saves: "Here's the `summary` I saved to `out/summary.md`" and "The file was saved as your `todo.md`" read as values kept in memory, so a made-up save worded that way went unchecked. A path or file name in the verb's own clause now keeps it a claim; "saved to memory" and the rc18 bookshelf-slot aside are unchanged.
|
The remembered-value carve-out let two real saves through unchecked: "Here's the 🔍 Technical details
|
|
Not merged yet: the remembered-value carve-out still lets made-up saves through, even on a turn where the user asked for a save. On main each of these is flagged; on this head none are.
Next step: treat a path anywhere later in the sentence as a save (not only in the verb's own clause), then add these three to 🔍 Technical details
|
The remembered-value exemption only looked for a path in the verb's own clause, so "Here's the `summary` I saved, at `out/summary.md`." and "The `weekly-report` I saved: `out/report.md`." went unchecked. It now treats any path or file name in the sentence as a save. On a turn that asked for a save the exemption no longer applies at all, matching main.
# Conflicts: # tests/unit/agents/test_completion_evidence.py
|
All three saves from the verifier's list are checked again. A path or file name anywhere in the sentence now makes it a save claim, and on a turn that asked for a save the remembered-value reading doesn't apply at all, the same as main. The rc18 bookshelf-slot aside and "saved to memory" are still left alone. 🔍 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]>
…md#7539) A made-up file save can slip past the "unverified save" check again when it is worded as a denial with an exception. On a turn that asked for no save, "I saved nothing, except the summary to `out/summary.md`", "I wrote nothing else besides `out/r.md`", "I created no other file than `out/r.md`" and "Apart from `out/report.md`, no file was written" were all flagged before amd#7276 and are silent after it. This restores the check for them; plain denials ("I wrote no file this turn") and denials whose exception is not a saved file ("Besides, no file was written.", "Apart from reading report.pdf, I saved no files.") stay quiet. Post-merge review finding on amd#7276: the exception-clause gap its reviewer raised was closed only for an exception word directly after the negation. ## Test plan - [x] `python -m pytest tests/unit/agents/test_fabricated_save_guard.py`: new `SAVE_CLAIMS` cases fail on main, pass here; new `NON_CLAIMS` (exception word with no saved file) pass on main and here - [x] `python -m pytest -n 4 tests/unit/agents -k "save or completion or claim or refused or look or announced or grounding"`: 2158 passed - [x] Denials without an exception, or whose excepted file was only read or already existed ("Other than report.pdf, which I only read, I wrote no file."), are still not claims - [ ] Eval categories to watch on the next RC: gaia_honesty, gaia_files <details> <summary>🔍 Technical details</summary> - An exception overrides a denial only when the excepted phrase is a bare file, or "the X to/in/as <file>", followed directly by a clause boundary that does not open a relative clause. A file followed by "which/that", "being", its own verb, or "the fact that" is another clause, not a save. - "I didn't write any file except `out.csv`" (no claim verb of its own) is now caught too. - `nothing/no file [else|other] but|than` goes through the same object check. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
A read-only answer could end with "the requested output file has no recorded successful write", or GAIA would re-prompt itself, because the check read the answer's own denial ("I wrote no file this turn") as a claim that a file was saved. A recalled memory that mentioned a save had the same effect on every later turn. Denials are no longer claims, and the check reads only the user's own words.
Closes #7178
Draft until it is replayed in the app: this is the agent's turn-completion check.
Test plan
python -m pytest tests/unit/agents(7234 pass) with 8 denials that must not count, 5 near-miss real claims that still must, and the rc18 answer verbatim; 11 fail on main