Repository navigation
Conversation
…ixed parameters Pydantic rejects field names starting with underscore as private attributes. Parameters like `_tenant` or `_session` were silently dropped from the tool schema, making it impossible for LLMs to supply them. This caused ToolInvocationError when the function had required underscore parameters. The fix uses safe internal field names with Pydantic Field(alias=...) to preserve the original underscore-prefixed names in the JSON schema and during tool invocation. This applies to both create_tool_from_function and ComponentTool, and handles: - Required parameters with leading underscores - Optional parameters with leading underscores (with defaults) - Annotated parameters with descriptions - Multiple underscore parameters in the same function Fixes deepset-ai#13472 Co-Authored-By: Claude Code <[email protected]>
…ixed parameters Add release note for underscore parameter fix Add .claude/ to .gitignore
|
@inmassat is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @inmassat, thanks for your interest in contributing to Haystack! 🙏 This is an automated message to help us keep the review queue healthy. |
|
Hi @inmassat, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
Thanks for signing the CLA, @inmassat! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
|
Thanks for signing the CLA, @inmassat! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
|
Closing as duplicate of #13567 |
Related Issues
create_tool_from_function/@toolsilently drops parameters whose name starts with_, making the tool uncallable #13472Proposed Changes:
\create_tool_from_function\ and the @tool\ decorator were silently dropping parameters whose names start with an underscore (e.g., _tenant, _session). This made tools with required underscore-prefixed parameters uncallable, as the parameters were missing from the generated JSON schema.
The fix uses Pydantic's \Field(alias=...)\ feature to preserve original parameter names in the schema while using safe internal field names. The same fix has been applied to \ComponentTool\ which builds its schema similarly.
How did you test it?
Notes for the reviewer
Checklist
efactor:, \perf:, \ est:\ and added !\ in case the PR includes breaking changes.