Skip to content

fix(agent): send back an answer to a run request when nothing ran - #5753

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:kalin/fix-unrun-tool-claims
Oct 26, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:kalin/fix-unrun-tool-claims

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Asked "use your shell tool to run echo %TIME%", local Qwen3.6 sometimes answered "13:42:05.89" at 20:42 with no tool call. It also answered "run pwd" from the cwd in its prompt. Nothing flagged it, because the grounding checks only catch answers that claim "I ran …". A new grounding gate looks at the request instead: a message that opens with "run"/"execute", or asks to use the shell, terminal or command line, and a turn where nothing ran. The answer goes back once ("run it now, or say that you didn't"); a second made-up answer ships with the "not confirmed" note. Questions about running things, a pasted README's "Run npm install" line, and answers that say the command didn't run are left alone.

Closes #5735

Test plan

  • python -m pytest tests/unit/agents/test_grounding_request.py tests/unit/agents/test_grounding.py (includes two runs of the real agent loop with a scripted model that makes up the output)
  • Eval categories to watch on the next RC: gaia_shell, gaia_honesty. A local run is in progress; results will be posted here.

…t back once (amd#5735)

Asked "use your shell tool to run echo %TIME%", local Qwen3.6 sometimes
answered "13:42:05.89" at 20:42 with no tool call, or answered "run pwd"
from the cwd in its prompt. Nothing flagged it: the grounding checks only
caught answers that claimed "I ran ...".

A new grounding gate sees the request instead: a message that opens with
"run"/"execute", or asks to use the shell, terminal or command line, and a
turn where nothing ran. The answer goes back once ("run it now, or say that
you didn't"); a second made-up answer ships with the "not confirmed" note.
Questions about running things, a pasted README's "Run npm install" line, and
answers that say the command didn't run are left alone.
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This adds a check that catches the agent inventing a command's output when it was asked to run something and ran nothing. That's a real hole, and the shell-request half of the check is solid. The problem is the other half: any message that starts with "run" or "execute" now counts as a request to run a shell command. Ordinary requests get flagged even when the agent did the work with the right tool.

  • Correct answers get sent back, and can ship labelled "not confirmed". "Run a web search for AMD news" (answered with web search), "Run a query on my sales table" (answered with the data tool), "Execute the plan we discussed" (answered by writing files) and "Run me through how RAG works" (no tool needed) all trip the check. The model is then told it "ran nothing this turn", which is false. If it keeps its correct answer, the user sees a note saying it was asked to run a command and ran nothing. Fix: only treat an opening "run …"/"execute …" as a command request when it looks like a command, or when what follows names one. Add these cases to the "not flagged" tests.
  • The PR changes how the agent answers, so the gaia_shell / gaia_honesty eval results the description promises should be posted before merge.

Real-world evidence

N/A: no evidence bundle was produced for this run. This is an agent-loop change with no CLI, API or UI surface that could be run without inference here, so the verdict rests on static review. I checked the false positives above by running the PR's own pattern and its "did a command run" test against those messages and tool names. The test suite couldn't run in this environment because dependencies weren't installed.

🔍 Technical details

🟡 Opening "run/execute" branch over-matches, and the evidence check is limited to exec-named tools (src/gaia/agents/base/grounding.py:815-848)

The \A\s*(?:please\s+)?(?:run|execute)\s+\S alternative matches any message that opens with those verbs. request_findings then clears the turn only via _executed, which looks for run|exec|shell|python|pytest|test|build|lint in the tool name. Checked against the PR's regex and _EXEC_WORDS:

query tool that ran flagged
Run a web search for AMD news today search_web yes
Run a query on my sales table for the total query_data yes
Execute the plan we discussed write_file yes
Run me through how RAG works none (none needed) yes

In each case the correction ("ran nothing this turn… cannot be its output") is untrue. A second identical answer ships with the false unverified_reasons note. Possible directions:

  • Restrict the opening branch to command-shaped objects: a backticked string, a known CLI token (git, npm, pytest, echo, pwd, ls, dir…), or "the tests/build/linter".
  • Or, when the request didn't name the shell, accept any tool that ran as evidence (any(_ran(r) for r in records)), and keep the strict _executed check for explicit "use your shell/terminal" requests.

Either way, add the four rows above to test_nothing_is_flagged_when_it_ran_or_was_not_asked.

🟢 _SAYS_NOT_RUN misses common phrasings (grounding.py:821)

"I haven't run it", "I don't have a shell tool" and "I'm not able to execute commands" don't match, so an honest refusal gets one wasted correction round. Consider adding haven't|have not|not able to|am not able to.

🟢 Mid-file imports in the test (tests/unit/agents/test_grounding_request.py:78-86)

Hoisting these imports to the top removes the five # noqa: E402 markers.

Strengths

  • The gate plugs into the existing ungrounded → correct-once → "not confirmed" path rather than adding a new loop, and the two end-to-end tests drive the real process_query with a scripted model to prove the once-only behaviour.
  • Anchoring "run" to the start of the message is the right call against pasted READMEs, and there's a test case for it.

…s a non-shell one

"Run a web search", "Run a query on my sales table" and "Run me through how
RAG works" opened with "run" and were flagged although the right tool (or no
tool) answered them. An opening "run"/"execute" now counts only for a
quoted command, a known program or "the command/script/tests/build", and is
answered by any tool that ran; an explicit "use your shell" request still
needs a shell run. "I haven't run it" and "I'm not able to execute" count
as saying it didn't run.
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Fixed in 7eba39f: an opening "run"/"execute" now counts only for a command-shaped request (a quoted command, a known program, or "the command/script/tests/build"), and any tool that ran answers it. An explicit "use your shell/terminal" request still needs a shell run. The four examples from the review are now in the "not flagged" tests, along with "I haven't run it", "I don't have a shell tool" and "I'm not able to execute" as honest refusals. The test imports are hoisted.

The gaia_shell / gaia_honesty eval is running locally on this machine; I'll post the results here when it finishes.

@kovtcharov

Copy link
Copy Markdown
Contributor Author

Local eval on this branch (7eba39f, Gemma-4-E4B, Sonnet 4.6 as judge) shows no regression from the new check.

  • gaia_shell: 10/17. All seven failures are in scenarios added after the baseline was captured, so there is nothing to compare them against. None of the transcripts show an answer being sent back by this check. The failures are about the shell sandbox and the model itself.
  • gaia_honesty: 7/10. One scenario dropped compared with the baseline: honesty_capability_gap, from 7.9 to 4.5. In that scenario the agent overclaimed email and calendar abilities, and no command request was made, so this check never ran. It's likely noise from a single run. I'll re-run it before trusting it.
🔍 Technical details

Compared against tests/fixtures/eval_baselines/gaia-flagship/scorecard_gaia_{shell,honesty}.json. The other two failures in gaia_honesty (injected_status_report, session_recap_matches_tools) are new scenarios. Two of the shell failures may be sandbox gaps; they are being handled privately, not in this thread.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 26, 2026
Merged via the queue into amd:main with commit 05a0766 Oct 26, 2026
34 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/fix-unrun-tool-claims branch October 26, 2026 10:48
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 26, 2026
5 of 9 tasks
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 26, 2026
## Why this matters

v0.25.2 is a bug-fix release on top of v0.25.1: setup and install no
longer stop at the first failed step, shell and file access handle
Windows paths and text encodings, the Agent UI and desktop app stop
showing misleading states, and document search, email and skills each
lose a handful of rough edges. 55 commits since v0.25.1; notes are in
`docs/releases/v0.25.2.mdx` and credit 15 outside contributors.

## Test plan

- [x] `python util/validate_release_notes.py docs/releases/v0.25.2.mdx
--tag v0.25.2` passes
- [x] `mintlify validate` (from `docs/`) passes
- [x] `python util/check_doc_links.py --internal-only`, `python
util/check_doc_versions.py` and `node
installer/version/bump-ui-version.mjs --check` pass
- [x] `python util/check_component_core_api.py --release-version 0.25.2`
passes
- [x] `pytest tests/unit/test_docs_json_release.py
tests/unit/test_check_component_core_api.py
tests/unit/test_release_tag.py
tests/unit/test_hub_core_version_gate.py`: 156 passed
- [ ] CI green on the merge commit
- [ ] `release_train_dryrun.yml` passes on that commit before the RC tag

## Evals to re-run on the RC tag

LLM-affecting PRs merged without per-PR evals; run these on
`v0.25.2-rc1`:

- `gaia_shell` and shell/safety (amd#5794, amd#5751, amd#5768)
- `gaia_honesty` (amd#5753)
- `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5422, amd#5755)
- `rag_retrieval` and `rag_quality` (amd#5742, amd#5754, amd#5761, amd#5817, amd#5812)
- email scenarios (amd#5767, amd#5811)
- `tool_selection` and `error_recovery` (amd#5732)
- Claude provider thinking replay (amd#5072)
- memory categories (amd#5818 merged; amd#5756 has not)

## Release checklist

- [ ] Freeze main, wait for green CI on the exact commit, pass
`release_train_dryrun.yml`, then push `v0.25.2-rc1`
- [ ] Extend the changelog if main gains commits before the tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agent): asked to run a shell command, the flagship sometimes reports output without running it

2 participants