Repository navigation
Conversation
added 2 commits
October 28, 2026 02:46
`description` only labels the call in the UI, and the bash tool already runs without it; the TUI then shows "Running shell command" instead. Listing it as required tells models they must send it, and some (Gemma 4 among them) leave it out anyway. The tools reference now lists it as optional.
Before a tool runs, the agent loop checks the call's arguments against the tool's `parameters` schema (`type`, `required`, `properties`, `additionalProperties`, `enum`, `items`) and answers a call that does not fit with one error listing every problem and its path; the tool does not run. A model that gets every problem at once can fix the call in one retry, rather than learning one problem per refused call. Valid arguments pass unchanged, other keywords and an empty schema are not checked, an optional argument sent as null counts as not sent, and unparsed `_raw_arguments` are left to the tool. The loop now runs a tool's `prepare_arguments` before the check and passes its result to the tool. The edit tool uses it to turn a top-level `oldText`/`newText` pair, or `edits` sent as a JSON string, into the `edits` list its schema declares.
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.
This PR checks a tool call's arguments against the tool's declared schema, before the tool runs, and answers a call that doesn't fit with a single error that lists each problem with enough specificity to allow recovery in few attempts, for example:
The checker covers the keywords tau's own tools use (
type,required,properties,additionalProperties,enum,items) as well other tools in my workflow, and the built-in tool definitions have been adjusted to match their actual existing behavior. Tests document the precise behavior.Implementation: This adds about 130 lines in
tau_agent, rather than using an existing library likejsonschema, as this narrower implementation is a good fit for the type of human/robot comprehensible errors we want to construct.The second commit makes bash's
descriptionoptional, some models (including Gemma 4) tend to leave it out which with validation would result in excessive validation refusals.All tests pass for each commit. The impact this has varies by model and model serving platform, with server-side schema validation this should never trigger but with local models and something like llama-server it makes a big difference. Details are in
dev-notes/tool-argument-validation.md.