Raise a ValueError when a tool's inputs_from_state key is missing from the Agent's state_schema

Open
#13,920 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
1/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read haystack/components/agents/agent.py and the unit tests for _warn_on_inputs_from_state_missing_from_schema; check the State docs page and the release note format for upgrade notes. Replace the warning behavior with the specified error and rename the helper, then update tests, docs, and the upgrade release note. The issue says this work will be handled internally and is not open to external contributions.

Written by the indexing model from the issue text.

Description

handled internally

Follow up to #13891

Since #13891, the Agent emits a FutureWarning at the start of each run when a tool's inputs_from_state reads a key that is not declared in the Agent's state_schema. State only holds keys from the schema, so such a key is never injected and the tool runs on its default or fails.

The warning says this will raise a ValueError starting with Haystack 3.7.

To do
  • Replace the FutureWarning in _warn_on_inputs_from_state_missing_from_schema (haystack/components/agents/agent.py) with a ValueError and rename the helper accordingly
  • Update the unit tests to expect the error
  • Update the State docs page, which says the Agent emits a FutureWarning
  • Add an upgrade release note

👋 Hello there! This issue will be handled internally and isn't open for external contributions. If you'd like to contribute, please take a look at issues labeled contributions welcome or good first issue. We'd really appreciate it!

Dominant language
Python
Stars
27.1k
Forks
3.5k
Avg merge
1d 8h
Merged PRs (30d)
239

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from deepset-ai/haystack

All issues in deepset-ai/haystack

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.