Repository navigation
fix(providers): name the unexpected properties in tool argument validation errors - #378
Merged
Merged
Conversation
…ation errors An additionalProperties failure reported only the path, so a caller that sent an unknown field could not tell which one to remove. Append the offending property names taken from the validator error params, and cover a nested and a top-level case in the validation test.
liuedcson
requested review from
MelodyVAR,
Uking-xxx and
ZouR-Ma
as code owners
November 30, 2026 06:22
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.
Problem
When a tool call carries a field outside a strict schema, the validation error only names the path:
The caller cannot tell which field to remove, so a model that sent a wrong field tends to repeat it on the next turn.
Change
validateToolArgumentsnow appends the offending property names, which the validator already reports inparams.additionalProperties:packages/providers/src/utils/validation.ts: addformatValidationMessageand use it when building the error list.packages/providers/test/validation.test.ts: cover a nested object entry.Validation
pnpm exec vitest --run test/validation.test.tsinpackages/providers: 10 passed.pnpm run check: all boundary checks andtsgo --noEmitpass.Not in this change
Enum failures still repeat the same path without listing the allowed values, and the allowed fields of the object are not listed yet.