openhands-tools 1.8.2__py3-none-any.whl → 1.9.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,6 @@ from openhands.sdk.logger import get_logger
9
9
  from openhands.sdk.tool.tool import ToolExecutor
10
10
  from openhands.tools.delegate.definition import DelegateObservation
11
11
  from openhands.tools.delegate.registration import get_agent_factory
12
- from openhands.tools.delegate.visualizer import DelegationVisualizer
13
12
 
14
13
 
15
14
  if TYPE_CHECKING:
@@ -130,14 +129,12 @@ class DelegateExecutor(ToolExecutor):
130
129
  factory = get_agent_factory(agent_type)
131
130
  worker_agent = factory.factory_func(sub_agent_llm)
132
131
 
133
- if isinstance(parent_visualizer, DelegationVisualizer):
134
- sub_visualizer = DelegationVisualizer(
135
- name=agent_id,
136
- highlight_regex=parent_visualizer._highlight_patterns,
137
- skip_user_messages=parent_visualizer._skip_user_messages,
138
- )
139
- else:
140
- sub_visualizer = None
132
+ # Use parent visualizer's create_sub_visualizer method if available
133
+ # This allows custom visualizers (e.g., TUI-based) to create
134
+ # appropriate sub-visualizers for their environment
135
+ sub_visualizer = None
136
+ if parent_visualizer is not None:
137
+ sub_visualizer = parent_visualizer.create_sub_visualizer(agent_id)
141
138
 
142
139
  sub_conversation = LocalConversation(
143
140
  agent=worker_agent,
@@ -211,13 +208,13 @@ class DelegateExecutor(ToolExecutor):
211
208
  results = {}
212
209
  errors = {}
213
210
 
214
- # Get the parent agent's name from the visualizer
211
+ # Get the parent agent's name from the visualizer if available
215
212
  parent_conversation = self.parent_conversation
216
213
  parent_name = None
217
214
  if hasattr(parent_conversation, "_visualizer"):
218
215
  visualizer = parent_conversation._visualizer
219
- if isinstance(visualizer, DelegationVisualizer):
220
- parent_name = visualizer._name
216
+ if visualizer is not None:
217
+ parent_name = getattr(visualizer, "_name", None)
221
218
 
222
219
  def run_task(
223
220
  agent_id: str,
@@ -61,6 +61,24 @@ class DelegationVisualizer(DefaultConversationVisualizer):
61
61
  )
62
62
  self._name = name
63
63
 
64
+ def create_sub_visualizer(self, agent_id: str) -> "DelegationVisualizer":
65
+ """Create a visualizer for a sub-agent during delegation.
66
+
67
+ Creates a new DelegationVisualizer instance for the sub-agent with
68
+ the same configuration as the parent visualizer.
69
+
70
+ Args:
71
+ agent_id: The identifier of the sub-agent being spawned
72
+
73
+ Returns:
74
+ A new DelegationVisualizer configured for the sub-agent
75
+ """
76
+ return DelegationVisualizer(
77
+ name=agent_id,
78
+ highlight_regex=self._highlight_patterns,
79
+ skip_user_messages=self._skip_user_messages,
80
+ )
81
+
64
82
  @staticmethod
65
83
  def _format_agent_name(name: str) -> str:
66
84
  """
@@ -1,7 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openhands-tools
3
- Version: 1.8.2
3
+ Version: 1.9.1
4
4
  Summary: OpenHands Tools - Runtime tools for AI agents
5
+ Project-URL: Source, https://github.com/OpenHands/software-agent-sdk
6
+ Project-URL: Homepage, https://github.com/OpenHands/software-agent-sdk
7
+ Project-URL: Documentation, https://docs.openhands.dev/sdk
8
+ Project-URL: Bug Tracker, https://github.com/OpenHands/software-agent-sdk/issues
5
9
  Requires-Python: >=3.12
6
10
  Requires-Dist: openhands-sdk
7
11
  Requires-Dist: bashlex>=0.18
@@ -11,9 +11,9 @@ openhands/tools/browser_use/logging_fix.py,sha256=6h5RhHnwL5wYo31ThuIqSA5-6hgFFE
11
11
  openhands/tools/browser_use/server.py,sha256=KQ_ULLQcJX0NtzWOUJUlppwKkZsHejT8ygHbLD40FRI,7720
12
12
  openhands/tools/delegate/__init__.py,sha256=Z3q2fvnkFp_n4FBN9KeZG70W-Ud_xUyaI8XUKrugDCs,511
13
13
  openhands/tools/delegate/definition.py,sha256=o3Jxiv5-fG3Om_PHgOCju0COuAtQ9Ylx5hJRxtqEV2g,3827
14
- openhands/tools/delegate/impl.py,sha256=Wpnf7EhirnCsb6XWFcB89hNEc8nZgMV4V4FEhuBGHHk,12039
14
+ openhands/tools/delegate/impl.py,sha256=hy2vhPThKZoVdtE3I3YbsH4_HPV-wM7XZTLs9BYE59I,11966
15
15
  openhands/tools/delegate/registration.py,sha256=1kOY4x7hjT0wJ9Xvzledg5AhXmvzC8pOtcQxpr__XC8,3981
16
- openhands/tools/delegate/visualizer.py,sha256=uq3KO2leFO37j69OsanP9bL0Bo1HLXU8V0jJhjoPkBw,8347
16
+ openhands/tools/delegate/visualizer.py,sha256=yNHRKJQ9th9bqJwxhJ7M20bhZ8bTQQ3a28IoY94rRhE,8991
17
17
  openhands/tools/delegate/templates/delegate_tool_description.j2,sha256=U7dx1QycfFaBrkg8sBaS8hJBTHuihL6_o9u_x62hzvY,1580
18
18
  openhands/tools/file_editor/__init__.py,sha256=l6M91CSb1lVOWteg__y7t8BE2HSOY1x5GC8djrTJVJQ,337
19
19
  openhands/tools/file_editor/definition.py,sha256=_aJzJYqxe_GTaRU36gsX9ZBRToLTVkGzpLJAKEEto9o,9985
@@ -74,7 +74,7 @@ openhands/tools/tom_consult/definition.py,sha256=MTdOCOJaEGgOXhlJ9-x0HdhD6JiKNT2
74
74
  openhands/tools/tom_consult/executor.py,sha256=LkWeltj-7ZgLhVZKZP4cuhxqg2YuyRnqSz5S0U9WElk,16656
75
75
  openhands/tools/utils/__init__.py,sha256=AgJX59QLQTulZqIvJnUqM7LxAgsFhtqmgol-lKLc7Wc,1253
76
76
  openhands/tools/utils/timeout.py,sha256=AjKNLZa8NqQ0HllZzqWZwZMj-8PEWHHBXwOlMjTygpA,399
77
- openhands_tools-1.8.2.dist-info/METADATA,sha256=1FwlaH-xmSAPAB_l7GziI1CnN6pXKDGrtuTtVhgtK4k,418
78
- openhands_tools-1.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
79
- openhands_tools-1.8.2.dist-info/top_level.txt,sha256=jHgVu9I0Blam8BXFgedoGKfglPF8XvW1TsJFIjcgP4E,10
80
- openhands_tools-1.8.2.dist-info/RECORD,,
77
+ openhands_tools-1.9.1.dist-info/METADATA,sha256=VjYFUj5ntXNeSXyHsxPfPspMbXMe9_lijeHJfpIxrZE,698
78
+ openhands_tools-1.9.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
79
+ openhands_tools-1.9.1.dist-info/top_level.txt,sha256=jHgVu9I0Blam8BXFgedoGKfglPF8XvW1TsJFIjcgP4E,10
80
+ openhands_tools-1.9.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5