Skip to content

refactor: Toolset refactoring - pt. 1 - #12298

Merged
anakin87 merged 20 commits into
mainfrom
toolset-progressive-refactor
Aug 11, 2026
Merged

refactor: Toolset refactoring - pt. 1#12298
anakin87 merged 20 commits into
mainfrom
toolset-progressive-refactor

Conversation

@anakin87

@anakin87 anakin87 commented Aug 11, 2026

Copy link
Copy Markdown
Member

Related Issues

Proposed Changes:

First part of the refactoring proposed in the PR above:

  • keep minimal spawn() and get_selectable_tools() implementations in the base class, but move specific behaviors to SearchableToolset
  • rework warm_up: remove _is_warmed_up flag; make Agent.warm_up() call warm_up_tools on every call. This is more aligned with other warm_up methods in Haystack, but now a specific implementation must know how to avoid doing expensive work multiple times.
  • deprecate + support; deprecate add support for Toolset. Users can still pass tools=[my_toolset, another_toolset]

How did you test it?

CI, new tests

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview Aug 11, 2026 9:30am

Request Review

@github-actions github-actions Bot added topic:tests type:documentation Improvements on the docs labels Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/agents
  agent.py
  utils.py 126
  haystack/tools
  searchable_toolset.py
  toolset.py 407
  haystack/tools/skills
  skill_toolset.py
Project Total  

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

@anakin87 anakin87 changed the title Toolset progressive refactor refactor: Toolset refactoring -pt. 1 Aug 11, 2026
@anakin87 anakin87 changed the title refactor: Toolset refactoring -pt. 1 refactor: Toolset refactoring - pt. 1 Aug 11, 2026
@anakin87
anakin87 marked this pull request as ready for review August 11, 2026 09:32
@anakin87
anakin87 requested a review from a team as a code owner August 11, 2026 09:32
@anakin87
anakin87 removed the request for review from a team August 11, 2026 09:32
@anakin87
anakin87 requested a review from sjrl August 11, 2026 09:32
Comment on lines 570 to 574
def _warm_up_hooks(self) -> None:
"""Warm up the configured hooks once."""
if not self._hooks_warmed_up:
warm_up_hooks(self.hooks)
self._hooks_warmed_up = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we open a follow up issue to similarly remove this guard for Hooks?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll handle this in the Agent mutation work but yes, it's something to take into consideration

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@anakin87
anakin87 merged commit d8e3bc1 into main Aug 11, 2026
29 checks passed
@anakin87
anakin87 deleted the toolset-progressive-refactor branch August 11, 2026 09:49
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.

2 participants