Repository navigation
fix: return invalid tool arguments to the model for correction - #30
Open
cyyecao-lappland wants to merge 1 commit into
Open
cyyecao-lappland wants to merge 1 commit into
cyyecao-lappland wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Malformed JSON currently aborts the agent before it can return a tool error, and non-object arguments to
final_answercan terminate the run with an error string. Catch JSON decoding failures and require a JSON object before casting or execution. Append tool feedback using the original call ID and continue, including for invalidfinal_answercalls. Keep the existing empty-string behavior for zero-argument tools and document the recovery behavior.Validation
The local environment uses Python 3.11 and
mcp==1.30.0: current main cannot import with MCP 2.x (tracked in #22). Full unit/snapshot runs retain two pre-existing gateway cases failing with the installed any-llm-sdk 1.30.0 (tracked in #23). Full mypy retains three errors in the unchanged A2A executor on Python 3.11; these were reproduced on main. The repository pre-commit launcher was attempted but could not finish creating its notebook hook environment: it expected Python 3.13 and detected 3.13.15. No notebook is changed. Full source/test Ruff lint and formatting and mypy of the changed source/test pass.PR Type
Relevant issues
Fixes #29
Checklist
AI Usage Information
AI Model used: GPT-6
AI Developer Tool used: Codex desktop
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.
I am an AI Agent filling out this form.