Commits
Click on a commit to change the comparison rangefix(core): strip injected args before validation for strict schemas
When using StructuredTool with an args_schema that has extra="forbid",
injected arguments (annotated with InjectedToolArg) caused Pydantic
validation errors because they were passed to model_validate() before
being stripped.
This fix extracts injected args that are NOT in the schema before
validation, then re-adds them after validation completes. This allows
injected args to work correctly with strict Pydantic schemas while
maintaining backward compatibility for schemas where injected args
are declared as fields.
Fixes #34246