Repository navigation
fix(agent): never read an unanswered question as the user's answer - #7322
Conversation
When nobody answered "What kind of cleanup do you want?" within five minutes, the agent was handed its own default as if the user had picked it, moved 15 files and replied "Done". Now it is told the user did not answer; its reply has to say what it assumed, and any step that changes files after that waits for a person's approval, even with Full access on. request_user_input no longer passes the model's default to the console as the timeout value: a timeout returns "__NO_RESPONSE__" with a plain statement that nobody answered, naming the default only as an assumption. The turn remembers the unanswered question, and ChatAgent marks any non-read call after it with NEEDS_PERSON_ARG, which pre-approval never answers; an answered question clears the hold. Closes #ISSUE
|
Verdict: Request changes This fixes a real problem. When a user leaves a clarifying question unanswered, the agent no longer treats its own default as the user's choice, and file changes made after that wait for a person, even with Full access on. One gap remains in the hold. Some actions still go through without asking: removing a skill, wiping memory, installing a CLI and connector (MCP) tools. They get through because the check only knows the risk of shell, Python and file-writing tools. In the rc18 scenario a connector tool could still move or write files on the guessed answer.
Real-world evidenceN/A: no evidence bundle was produced for this run. This review rests on reading the code alone. Pytest isn't installed on this runner, so the new tests weren't run here either. The PR is open as a draft until it is replayed in the app. Its unchecked Full-access replay item is the evidence that matters, and so are the eval categories it names ( 🔍 Technical detailsIssues 🟡 The hold skips gated tools that Treating only a known read as exempt is safe. After this change, 🟡 Spec still documents the old timeout contract ( Strengths
|
The hold only covered shell, Python and file-writing tools, so a connector (MCP) tool, remove_skill, forget_everything, install_cli or a skill's send still ran on the model's guessed answer with Full access on. Now every gated call that is not a known read waits for a person; the marker only matters on a call that already asks, so ungated tools gain no prompt. The autonomous-agent-mode spec still promised the default back on a timeout; it now describes the "__NO_RESPONSE__" result and the hold.
|
Both review points are fixed in d7e0784: after an unanswered question, every action that already asks for approval now waits for a person unless it is a known read-only command, and the spec no longer says a timeout returns the default. 🔍 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]>
When nobody answered "What kind of cleanup do you want?" within five
minutes, the agent was handed its own default as if the user had picked
it, moved 15 files and replied "Done". Now it is told the user did not
answer; its reply has to say what it assumed, and any step that changes
files after that waits for a person's approval, even with Full access on.
Closes #7294
Draft until it is replayed in the app: this changes a check or tool result the agent reads.
Test plan
python -m pytest hub/agents/gaia/python/tests/test_unanswered_question.py hub/agents/gaia/python/tests/test_request_user_input_window.py(15 pass; 6 fail on main)