Skip to content

fix: preserve lazy toolsets added before warm-up#12012

Open
Success6666 wants to merge 1 commit into
deepset-ai:mainfrom
Success6666:fix/toolset-add-lazy
Open

fix: preserve lazy toolsets added before warm-up#12012
Success6666 wants to merge 1 commit into
deepset-ai:mainfrom
Success6666:fix/toolset-add-lazy

Conversation

@Success6666

Copy link
Copy Markdown

Related Issues

Proposed Changes:

Toolset.add() only warmed the object being added when the parent had already been warmed. A lazy child Toolset was therefore flattened while still empty when added to a cold parent, and its tools could not be recovered later.

  • Warm child Toolset instances before flattening them.
  • Keep the existing cold-parent behavior for plain Tool instances.
  • Add regression coverage for lazy loading, idempotent warm-up, and duplicate-name validation.
  • Add a release note for the behavior fix.

How did you test it?

  • hatch run test:unit test/tools/test_toolset.py -q (33 passed)
  • hatch run test:types (Success: no issues found in 371 source files)
  • hatch run pre-commit run --files haystack/tools/toolset.py test/tools/test_toolset.py releasenotes/notes/fix-toolset-add-lazy-c73a533f031c72d2.yaml

Notes for the reviewer

The change intentionally warms only child Toolset instances before flattening. Adding a plain Tool to a cold parent remains deferred until the parent is warmed.

This PR was fully generated with an AI assistant. The changes were reviewed against the affected code path and the relevant tests were run locally.

Checklist

@Success6666
Success6666 requested a review from a team as a code owner July 15, 2026 01:28
@Success6666
Success6666 requested review from anakin87 and removed request for a team July 15, 2026 01:28
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

Someone 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 Jul 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Toolset.add() silently drops tools from lazy Toolsets before parent warm-up

2 participants