Repository navigation
Rename HookToolset tool_name_prefix to tool_prefix - #74447
Merged
Lee-W merged 5 commits intoOct 12, 2026
Merged
Conversation
kaxil
reviewed
Oct 8, 2026
Lee-W
force-pushed
the
common-ai-hook-toolset-tool-prefix
branch
from
October 9, 2026 04:54
4b83941 to
e3c63f7
Compare
kaxil
reviewed
Oct 10, 2026
Lee-W
force-pushed
the
common-ai-hook-toolset-tool-prefix
branch
from
October 11, 2026 06:58
e3c63f7 to
6f1fe3b
Compare
`MCPToolset` and `SandboxToolset` already name this parameter `tool_prefix`. Align `HookToolset` before the 1.0 release, and keep `tool_name_prefix` as a deprecated alias that raises `ValueError` when it conflicts with `tool_prefix`.
- `tool_prefix="s3"` now names the tool `s3_list_keys`, matching
`SandboxToolset`, `ObjectStorageToolset` and `MCPToolset`.
- `tool_prefix` must be a valid identifier, otherwise `ValueError`.
- The deprecated `tool_name_prefix` keeps its raw concatenation.
- Passing both now requires `tool_name_prefix == f"{tool_prefix}_"`.
- Docs and example Dags use `"s3"` / `"http"`.
Every toolset that takes a prefix now calls it `tool_prefix`, so the error no longer lists them per class.
- The `tool_name_prefix` deprecation warning now suggests the `tool_prefix` value to use, with the trailing `_` removed - Renaming `tool_name_prefix="s3_"` to `tool_prefix="s3_"` would otherwise name the tools `s3__list_keys`
- The duplicate tool name error now tells the user to give the toolsets different `tool_prefix` values "where they take one" - `SQLToolset` and `DataFusionToolset` take no `tool_prefix`, so the unqualified advice led to a `TypeError`
Lee-W
force-pushed
the
common-ai-hook-toolset-tool-prefix
branch
from
October 11, 2026 09:38
6f1fe3b to
e8d3828
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MCPToolsetandSandboxToolsetalready name this parametertool_prefix, whileHookToolsetcalls ittool_name_prefix. AlignHookToolsetbefore the 1.0 release so the three toolsets share one name.What
HookToolsetacceptstool_prefix. It is joined to the method name with_(tool_prefix="s3"givess3_list_keys) and must be a valid identifier, likeSandboxToolset,ObjectStorageToolsetandMCPToolset.tool_name_prefixstays as a deprecated alias, concatenated as given, and emitsAirflowProviderDeprecationWarning. Passing both is accepted whentool_name_prefix == f"{tool_prefix}_"and raisesValueErrorotherwise.tools/__init__.py, the docs (toolsets/hook.rst,agent_security.rst,stability.rst) and the example Dags (example_agent.py,example_hook_toolset.py) use the new name.providers/common/ai/tests/unit/common/ai/:toolsets/test_hook.py(prefix joining, identifier validation, deprecated alias, both-passed) andtools/test__from_toolset.py.Was generative AI tooling used to co-author this PR?
Generated-by: [Claude] following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.