Skip to content

fix: validate ComponentTool custom parameters - #13211

Open
D1822787566 wants to merge 1 commit into
deepset-ai:mainfrom
D1822787566:codex/component-tool-schema-validation
Open

D1822787566 wants to merge 1 commit into
deepset-ai:mainfrom
D1822787566:codex/component-tool-schema-validation

Conversation

@D1822787566

Copy link
Copy Markdown

Related Issues

  • No existing issue covers this specific ComponentTool schema validation gap.

Proposed Changes

ComponentTool now validates custom parameters schemas against the wrapped component's input sockets during construction. Unknown top-level properties raise a clear ValueError before tool invocation, instead of causing a late KeyError when the tool is called.

The existing JSON Schema validation and support for implicit schemas remain unchanged.

How did you test it?

  • hatch -e test run pytest test/tools/test_tool.py test/tools/test_component_tool.py -q
    • 80 passed, 7 skipped, 1 warning
  • hatch run ruff check haystack/tools/component_tool.py test/tools/test_component_tool.py
  • hatch run ruff format --check haystack/tools/component_tool.py test/tools/test_component_tool.py
  • pre-commit hooks passed during commit

Notes for the reviewer

The change is intentionally limited to explicit custom schema properties. It does not require every component input to be listed, preserving existing schemas that rely on implicit or state-provided inputs.

This PR was fully generated with an AI assistant. I have reviewed the changes and run the relevant tests.

Checklist

  • I have read the contributors guidelines and code of conduct.
  • I have added unit tests.
  • I have added a release note file.
  • I have used a conventional commit title.
  • I have run the relevant checks locally.

@D1822787566
D1822787566 requested a review from a team as a code owner October 11, 2026 07:49
@D1822787566
D1822787566 requested review from sjrl and removed request for a team October 11, 2026 07:49
@vercel

vercel Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

@D1822787566 is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Oct 11, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @D1822787566, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from sjrl October 11, 2026 08:55
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Oct 11, 2026
@HaystackBot
HaystackBot marked this pull request as draft October 11, 2026 08:55
@HaystackBot
HaystackBot marked this pull request as ready for review October 11, 2026 09:31
@HaystackBot
HaystackBot requested a review from sjrl October 11, 2026 09:31
@HaystackBot HaystackBot removed the cla-pending PR is in draft until the contributor signs the CLA label Oct 11, 2026
@HaystackBot

Copy link
Copy Markdown
Contributor

Thanks for signing the CLA, @D1822787566! 🎉 This PR is now ready for review again and the reviewer has been re-assigned.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants