Repository navigation
fix(coderd/x/chatd): shorten tool input validation errors - #32078
Merged
Merged
Conversation
mafredri
approved these changes
Nov 12, 2026
| return compiled.Validate(value) | ||
| // jsonschema-go wraps each recursive error with an absolute schema path. | ||
| // Keep the innermost wrapper so the location and cause are reported once, | ||
| // without repeating every ancestor path. |
Member
There was a problem hiding this comment.
Does the validator error out on the first error, or list multiple errors? Just wondering if we notify of both missing fields if there are two, or just the one with this unwrapping.
Collaborator
Author
There was a problem hiding this comment.
The validator generally stops at the first failing check. My agent told me there are some exceptions
a single required check lists all missing properties of that object. If both fields are missing, it reports:
required: missing properties: ["old_text" "new_text"]anyOf failures can include errors from multiple branches, embedded in the cause’s message. Those are also preserved.
This branch was previously 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Nested builtin tool input errors repeat an absolute schema path at every recursion level. Unwrap the validator's error chain to retain only the innermost path wrapper and its cause, with a comment explaining the dependency's wrapping behavior. Also remove the redundant sentence about exact property names and duplicate keys from the retry guidance.
Existing schema-validation tests now assert complete tool error messages for root failures, nested properties, arrays, and maps. Validation behavior and diagnostics embedded in the cause are preserved.
Refs #31541.