Invalid JSON tool arguments abort the run or prematurely return a final-answer error
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start in the model loop where serialized tool arguments are parsed, then trace how invalid values reach ToolExecutor. Reproduce the twelve malformed-argument cases with local mocked model responses, including empty arguments and multiple calls in one response. Done means invalid calls return tool feedback with their original ID and name, valid calls still execute, and the model can correct the call without a premature final answer.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
The model loop parses tool arguments with an unguarded json.loads. A truncated JSON object raises JSONDecodeError before ToolExecutor can return tool feedback. JSON null and scalar values can fail in the argument-casting loop. Arrays or strings can reach the executor and produce a Python kwargs error; when the tool is final_answer, that error is returned as the final output instead of allowing correction.
Reproduction
On current main, mock the first completion to call a registered echo(text: str) tool (or final_answer) with {"text":, null, [], "hello", 42, or true as its serialized arguments. Provide a corrected tool call and a valid final answer in subsequent mocked completions. The run raises or ends before consuming the corrected call.
Expected behavior
Return a tool error with the original tool-call ID and name, do not invoke a tool with invalid arguments, and let the model correct the call. Other valid calls in the same response should still execute. An empty argument string should keep working for zero-argument tools.
Verification
The twelve malformed-argument cases fail on main. The proposed local fix passes sixteen cases, including empty arguments and valid calls following an invalid call in the same batch. No live model requests are needed.
AI disclosure
This contribution was autonomously authored and tested with Codex (GPT-6), at the account owner's explicit request. Tests use local mocked model responses; no live model call or human review is claimed.
- Lingua principale
- Python
- Stelle
- 33
- Fork
- 7
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mozilla-ai/tinyagent
-
Running an agent mutates the caller-provided message listForse già presa @cyyecao-lappland l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
mozilla-ai/tinyagent#27 ·
-
Add Python 3.14 supportForse già presa @barredterra l’ha presa 121 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
mozilla-ai/tinyagent#16 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
mozilla-ai/tinyagent#24 ·
-
`uses_openai` gateway prefix is unreachable since any-llm retired the `gateway` providerForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
mozilla-ai/tinyagent#23 · 2 commenti ·
-
`import tinyagent` raises NameError with mcp >= 2.0Forse già presa @tonycoder-hub l’ha presa 24 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
mozilla-ai/tinyagent#22 ·
Tutte le issue di mozilla-ai/tinyagent
Issue simili
-
Validate non-divisible effective batch sizes in the Unsloth LoRA backendForse già presa @debesh-biswas l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
`rx.Model` event arguments emit `PydanticDeprecatedSince20` once per payload keyForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
reflex-dev/reflex#7634 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
topoteretes/cognee#6239 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ranaroussi/yfinance#3009 ·
I maintainer di solito rispondono entro 1 giorno
-
Test discovery aborts on GPU builds without cuStateVec: check_cuStateVec expects a failed result but set_config() now raises RuntimeErrorForse già presa @dmeliksetian l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Qiskit/qiskit-aer#2495 ·
I maintainer di solito rispondono entro 1 giorno