1- """Delegate tool definitions for OpenHands agents."""
1+ """Delegate tool definitions for OpenHands agents.
2+
3+ .. deprecated:: 1.16.0
4+ DelegateTool is deprecated in favor of TaskToolSet. Use TaskToolSet for
5+ sub-agent delegation. DelegateTool will be removed in version 1.23.0.
6+ """
27
38import pathlib
49from collections .abc import Sequence
1419 ToolAnnotations ,
1520 ToolDefinition ,
1621)
22+ from openhands .sdk .utils .deprecation import warn_deprecated
1723
1824
1925if TYPE_CHECKING :
@@ -61,7 +67,12 @@ class DelegateObservation(Observation):
6167
6268
6369class DelegateTool (ToolDefinition [DelegateAction , DelegateObservation ]):
64- """A ToolDefinition subclass that automatically initializes a DelegateExecutor."""
70+ """A ToolDefinition subclass that automatically initializes a DelegateExecutor.
71+
72+ .. deprecated:: 1.16.0
73+ DelegateTool is deprecated in favor of TaskToolSet. Use TaskToolSet for
74+ sub-agent delegation. DelegateTool will be removed in version 1.23.0.
75+ """
6576
6677 @classmethod
6778 def create (
@@ -72,6 +83,9 @@ def create(
7283 ) -> Sequence ["DelegateTool" ]:
7384 """Initialize DelegateTool with a DelegateExecutor.
7485
86+ .. deprecated:: 1.16.0
87+ Use TaskToolSet instead. DelegateTool will be removed in version 1.23.0.
88+
7589 Args:
7690 conv_state: Conversation state (used to get workspace location)
7791 max_children: Maximum number of concurrent sub-agents (default: 5)
@@ -84,6 +98,13 @@ def create(
8498 Returns:
8599 List containing a single delegate tool definition
86100 """
101+ warn_deprecated (
102+ "DelegateTool" ,
103+ deprecated_in = "1.16.0" ,
104+ removed_in = "1.23.0" ,
105+ details = "Use TaskToolSet instead for sub-agent delegation." ,
106+ )
107+
87108 # Import here to avoid circular imports
88109 from openhands .sdk .subagent import get_factory_info
89110 from openhands .tools .delegate .impl import DelegateExecutor
0 commit comments