Skip to content

fix: validate ComponentTool custom parameters - #13211

Merged
sjrl merged 6 commits into
deepset-ai:mainfrom
D1822787566:codex/component-tool-schema-validation
Nov 2, 2026
Merged

sjrl merged 6 commits into
deepset-ai:mainfrom
D1822787566:codex/component-tool-schema-validation

Conversation

@D1822787566

@D1822787566 D1822787566 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Related Issues

  • No linked issue.

Proposed Changes

ComponentTool skips invocation arguments that are not component inputs and logs the skipped names, preventing a late KeyError for extra custom-schema properties or arguments added by an LLM. Construction also warns about unknown properties in a custom parameters schema.

Custom schemas must cover mandatory component inputs unless they are supplied through inputs_from_state or injected as State. Missing inputs raise a ValueError during construction. This also covers an AgentTool custom schema that omits messages without supplying it through inputs_from_state.

How did you test it?

  • hatch -e test run pytest test/tools/test_tool.py test/tools/test_component_tool.py test/tools/test_agent_tool.py -q --tb=short -o log_cli=false
    • 101 passed, 8 skipped, 1 existing Pydantic schema warning.
    • Covers separate synchronous and asynchronous unknown-argument handling, custom-schema round trips, missing mandatory inputs, State inputs, and AgentTool messages supplied through state.
  • hatch run test:types test/tools/test_component_tool.py test/tools/test_agent_tool.py
    • No issues found in 2 source files.
  • hatch run ruff check test/tools/test_component_tool.py test/tools/test_agent_tool.py
  • hatch run ruff format --check test/tools/test_component_tool.py test/tools/test_agent_tool.py
  • Pre-commit hooks passed during commit.
  • git diff --check passed.

Notes for the reviewer

The follow-up separates sync and async tests into their respective classes and documents the AgentTool messages check in the release note. Two AgentTool tests verify both missing messages and messages provided through state. The follow-up changes tests and the release note only.

This PR was generated with an AI assistant.

Checklist

  • I have read the contributors guidelines and code of conduct.
  • I have added unit tests and updated the docstrings.
  • 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.

@sjrl sjrl self-assigned this Oct 12, 2026
@github-actions github-actions Bot added the type:documentation Improvements on the docs label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/core/pipeline
  pipeline.py
  haystack/tools
  component_tool.py
Project Total  

This report was generated by python-coverage-comment-action

Comment thread haystack/tools/component_tool.py Resolved
Comment thread haystack/tools/component_tool.py Resolved
Comment thread haystack/tools/component_tool.py Resolved
Comment thread test/tools/test_component_tool.py Resolved
Comment thread test/tools/test_component_tool.py Resolved
Comment thread test/tools/test_component_tool.py Resolved
@sjrl

sjrl commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Hey @D1822787566 pinging to ask if you have time to work on this.

@sjrl
sjrl merged commit 3c44396 into deepset-ai:main Nov 2, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants