Repository navigation
fix(agents): recover from non-object tool arguments - #5732
kovtcharov-amd merged 1 commit into
Conversation
Reject malformed argument values before tool dispatch so the existing recovery loop can ask the model to correct them. Preserve conversational replies and closing-answer retries, with process_query regressions and behavior documentation.
|
Verdict: Approve Before this change, a model that sent a plain string or a list as a tool's arguments, instead of an object, crashed the whole chat turn with a raw Python error. Now the model is told which tool it called and what type it sent, and it gets a retry through the same retry budget that already handles malformed JSON. I found no blocking issues. The check runs before any tool executes, so one bad call in a parallel batch no longer lets the valid calls before it run. Real-world evidenceN/A here: this run produced no evidence bundle, and 🔍 Technical detailsIssues found 🟢 The two messages for a non-object native call disagree ( Checked and fine
Strengths
|
…md#5734) ## Summary Keep the original query error when saving that turn's undo history also fails. ## Why A turn that raises after changing a file can lose its real error if the snapshot store also runs out of space. The sidecar then reports “This is a bug” instead of the processing failure. The original error now survives, undo still gets its warning, and both tracebacks are logged even when the copy error suppresses exception context. ## Linked issue Closes amd#5666 ## Changes - Retain the processing exception across the recording context's finalization, without emitting a terminal event before recording ends. - Add four endpoint regressions for different original exception types, suppressed undo context, terminal ordering and session-lock cleanup. - Document the dual-failure behavior in the SSE contract. ## Test plan - [x] Final regression overlay on original production: **4 failed / 9 passed**; candidate endpoint suite: **13 passed**. - [x] Complete Linux `pytest tests/unit/ -n 4 --dist=worksteal`: **27508 passed / 478 skipped / 3 xfailed**, with 41 passing subtests. Collection guard passed unchanged. - [x] Complete flagship package suite on Linux Python 3.12.14 and Windows Python 3.12.13: **796 passed / 3 conditional skips** each. Linux subprocess imports were explicitly bound to the candidate too. - [x] Affected snapshot/changes/dispatch/relay contract suites: **206 passed / 2 conditional skips**; flagship collection guard and capability matrix passed. - [x] `python util/lint.py --all`: **17 passed / 1 configured nonblocking MyPy advisory**; staged lane/path checks passed. Wheel/sdist builds, Twine validation and independent installed-wheel import parity passed. - [x] Actual browser and HTTP/SSE proof below; native independent code/architecture review completed. - [ ] Next RC: watch `error_recovery` under the repository's no-local-Strix-Halo eval exception. Real model evals were not run here. An additional fixture-enabled relay-query diagnostic exposes the same old fake-handler mismatch on both revisions (**1 failed / 3 passed**, missing `set_relay_question`). It is recorded separately, not counted as green. The configured contract run above retains its normal conditional query skip; the actual browser proof uses the production handler and passes. ## Evidence [Exact commits, commands, versions, logs, controls and raw screenshots](https://github.com/jipeng6036-del/gaia/tree/c4b13d8618dcc9ebbbef2631613b53113fdd41f3). The real `gaia chat --ui` → browser → daemon → dev sidecar → GaiaAgent → `write_file` chain runs on both revisions. Only model HTTP replies and an isolated install receipt are fixtures. After the real file write, a separate **1 MiB tmpfs** produces genuine snapshot `ENOSPC`; no production Python code is monkeypatched. This tests the user path, not real inference/GPU behavior or a frozen binary installation.   - **Agent UI / HTTP:** before/after pages, reload recovery, persisted messages and six HTTP/SSE cases cover double failure plus success/undo-only and processing-only controls. - **CLI:** launched the actual `gaia chat --ui` command; logs and arguments are in the evidence harness. The in-process one-shot CLI is unchanged. - **MCP:** N/A; no MCP transport or tool schema changed. Baseline `82ad2a771c7ed5b6b26f4521b3e4eaad40820f85`; candidate `529dc35fd434f9582c3490b2f7f39d1797464c6b`. The manifest ties validation to all three committed blobs. The scripted processing error uses the independently tracked amd#5471 baseline case; this fix does not stack amd#5732's parser change. Hosted CI and human review are separate from these local results. ## Checklist - [x] Linked an issue and explained the user impact. - [x] Ran required local lint and tests; recorded conditional skips and diagnostic limits. - [x] Attached evidence from the affected user surface and marked the unchanged MCP surface N/A. - [x] Updated behavior documentation. AI-assisted implementation and verification; human review is pending.
## 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
Summary
Treat non-object tool arguments as a recoverable formatting error so the model can correct its call.
Why
A model sending a string or list instead of an argument object crashed the whole turn with a raw Python error. It now receives the tool name and the invalid argument type, retries, and can finish the request.
Linked issue
Closes #5471
Changes
Test plan
pytest tests/unit/ -n 4 --dist=worksteal --cov=src/gaia: original 27508 passed, candidate 27578 passed; each with 478 skips, 3 xfails and 41 passing subtests. Collection-skip guard passed unchanged.python util/lint.py --allsucceeded with its configured MyPy advisory; packaging: 13 passed, frontend/wheel builds passed.gaia chat --queryon original/source/installed wheel, plus the browser and HTTP/SSE proof below. Independent source and architecture review completed.tool_selectionanderror_recoveryunder the project's no-local-Strix-Halo eval exception. Real model evals were not run here.Evidence
Commands, versions, exact commits, logs and all four before/after cases. Only the external model HTTP replies are scripted; the actual CLI, UI, provider decoding, agent loop and file_info tool run normally. This does not validate real model inference or GPU behavior.
🔍 Technical details
Baseline
82ad2a771c7ed5b6b26f4521b3e4eaad40820f85; candidateada550c412069392b14df926401d4fcadcf15cb3. The manifest ties the complete local runs to the committed source blobs. Hosted checks are separate from these local results.Checklist