openhands-tools 1.9.1__py3-none-any.whl → 1.10.0__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.
@@ -14,6 +14,7 @@ if TYPE_CHECKING:
14
14
 
15
15
  from openhands.sdk.logger import DEBUG, get_logger
16
16
  from openhands.sdk.tool import ToolExecutor
17
+ from openhands.sdk.utils import sanitized_env
17
18
  from openhands.sdk.utils.async_executor import AsyncExecutor
18
19
  from openhands.tools.browser_use.definition import BrowserAction, BrowserObservation
19
20
  from openhands.tools.browser_use.server import CustomBrowserUseServer
@@ -43,6 +44,7 @@ def _install_chromium() -> bool:
43
44
  capture_output=True,
44
45
  text=True,
45
46
  timeout=300, # 5 minutes timeout for installation
47
+ env=sanitized_env(),
46
48
  )
47
49
 
48
50
  if result.returncode == 0:
@@ -15,7 +15,7 @@ from openhands.sdk.utils.deprecation import warn_cleanup
15
15
 
16
16
  warn_cleanup(
17
17
  "Monkey patching to prevent browser_use logging interference",
18
- cleanup_by="1.10.0",
18
+ cleanup_by="1.15.0",
19
19
  details=(
20
20
  "This workaround should be removed once browser_use PR #3717 "
21
21
  "(https://github.com/browser-use/browser-use/pull/3717) is merged "
@@ -2,6 +2,7 @@ import os
2
2
  import subprocess
3
3
  import time
4
4
 
5
+ from openhands.sdk.utils import sanitized_env
5
6
  from openhands.sdk.utils.truncate import maybe_truncate
6
7
  from openhands.tools.file_editor.utils.constants import (
7
8
  CONTENT_TRUNCATED_NOTICE,
@@ -32,7 +33,12 @@ def run_shell_cmd(
32
33
  process: subprocess.Popen[str] | None = None
33
34
  try:
34
35
  process = subprocess.Popen(
35
- cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
36
+ cmd,
37
+ shell=True,
38
+ stdout=subprocess.PIPE,
39
+ stderr=subprocess.PIPE,
40
+ text=True,
41
+ env=sanitized_env(),
36
42
  )
37
43
 
38
44
  stdout, stderr = process.communicate(timeout=timeout)
@@ -65,6 +71,7 @@ def check_tool_installed(tool_name: str) -> bool:
65
71
  check=True,
66
72
  cwd=os.getcwd(),
67
73
  capture_output=True,
74
+ env=sanitized_env(),
68
75
  )
69
76
  return True
70
77
  except (subprocess.CalledProcessError, FileNotFoundError):
@@ -8,6 +8,7 @@ from pathlib import Path
8
8
  from typing import TYPE_CHECKING
9
9
 
10
10
  from openhands.sdk.tool import ToolExecutor
11
+ from openhands.sdk.utils import sanitized_env
11
12
 
12
13
 
13
14
  if TYPE_CHECKING:
@@ -149,7 +150,12 @@ class GlobExecutor(ToolExecutor[GlobAction, GlobObservation]):
149
150
 
150
151
  # Execute ripgrep
151
152
  result = subprocess.run(
152
- cmd, capture_output=True, text=True, timeout=30, check=False
153
+ cmd,
154
+ capture_output=True,
155
+ text=True,
156
+ timeout=30,
157
+ check=False,
158
+ env=sanitized_env(),
153
159
  )
154
160
 
155
161
  # Parse output into file paths
@@ -6,6 +6,7 @@ from pathlib import Path
6
6
  from typing import TYPE_CHECKING
7
7
 
8
8
  from openhands.sdk.tool import ToolExecutor
9
+ from openhands.sdk.utils import sanitized_env
9
10
 
10
11
 
11
12
  if TYPE_CHECKING:
@@ -154,7 +155,12 @@ class GrepExecutor(ToolExecutor[GrepAction, GrepObservation]):
154
155
 
155
156
  # Execute ripgrep
156
157
  result = subprocess.run(
157
- cmd, capture_output=True, text=True, timeout=30, check=False
158
+ cmd,
159
+ capture_output=True,
160
+ text=True,
161
+ timeout=30,
162
+ check=False,
163
+ env=sanitized_env(),
158
164
  )
159
165
 
160
166
  # Parse output into file paths
@@ -209,7 +215,12 @@ class GrepExecutor(ToolExecutor[GrepAction, GrepObservation]):
209
215
 
210
216
  # Execute grep
211
217
  result = subprocess.run(
212
- cmd, capture_output=True, text=True, timeout=30, check=False
218
+ cmd,
219
+ capture_output=True,
220
+ text=True,
221
+ timeout=30,
222
+ check=False,
223
+ env=sanitized_env(),
213
224
  )
214
225
 
215
226
  # Parse output into file paths
@@ -5,6 +5,7 @@ import subprocess
5
5
  from typing import Literal
6
6
 
7
7
  from openhands.sdk.logger import get_logger
8
+ from openhands.sdk.utils import sanitized_env
8
9
  from openhands.tools.terminal.terminal.terminal_session import TerminalSession
9
10
 
10
11
 
@@ -19,6 +20,7 @@ def _is_tmux_available() -> bool:
19
20
  capture_output=True,
20
21
  text=True,
21
22
  timeout=5.0,
23
+ env=sanitized_env(),
22
24
  )
23
25
  return result.returncode == 0
24
26
  except (subprocess.TimeoutExpired, FileNotFoundError):
@@ -40,6 +42,7 @@ def _is_powershell_available() -> bool:
40
42
  capture_output=True,
41
43
  text=True,
42
44
  timeout=5.0,
45
+ env=sanitized_env(),
43
46
  )
44
47
  return result.returncode == 0
45
48
  except (subprocess.TimeoutExpired, FileNotFoundError):
@@ -13,6 +13,7 @@ import time
13
13
  from collections import deque
14
14
 
15
15
  from openhands.sdk.logger import get_logger
16
+ from openhands.sdk.utils import sanitized_env
16
17
  from openhands.tools.terminal.constants import (
17
18
  CMD_OUTPUT_PS1_BEGIN,
18
19
  CMD_OUTPUT_PS1_END,
@@ -106,7 +107,7 @@ class SubprocessTerminal(TerminalInterface):
106
107
  logger.info(f"Using shell: {resolved_shell_path}")
107
108
 
108
109
  # Inherit environment variables from the parent process
109
- env = os.environ.copy()
110
+ env = sanitized_env()
110
111
  env["PS1"] = self.PS1
111
112
  env["PS2"] = ""
112
113
  env["TERM"] = "xterm-256color"
@@ -1,12 +1,12 @@
1
1
  """Tmux-based terminal backend implementation."""
2
2
 
3
- import os
4
3
  import time
5
4
  import uuid
6
5
 
7
6
  import libtmux
8
7
 
9
8
  from openhands.sdk.logger import get_logger
9
+ from openhands.sdk.utils import sanitized_env
10
10
  from openhands.tools.terminal.constants import HISTORY_LIMIT
11
11
  from openhands.tools.terminal.metadata import CmdOutputMetadata
12
12
  from openhands.tools.terminal.terminal import TerminalInterface
@@ -41,7 +41,8 @@ class TmuxTerminal(TerminalInterface):
41
41
  if self._initialized:
42
42
  return
43
43
 
44
- self.server = libtmux.Server()
44
+ env = sanitized_env()
45
+ self.server = libtmux.Server(environment=env)
45
46
  _shell_command = "/bin/bash"
46
47
  if self.username in ["root", "openhands"]:
47
48
  # This starts a non-login (new) shell for the given user
@@ -58,7 +59,7 @@ class TmuxTerminal(TerminalInterface):
58
59
  x=1000,
59
60
  y=1000,
60
61
  )
61
- for k, v in os.environ.items():
62
+ for k, v in env.items():
62
63
  self.session.set_environment(k, v)
63
64
 
64
65
  # Set history limit to a large number to avoid losing history
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openhands-tools
3
- Version: 1.9.1
3
+ Version: 1.10.0
4
4
  Summary: OpenHands Tools - Runtime tools for AI agents
5
5
  Project-URL: Source, https://github.com/OpenHands/software-agent-sdk
6
6
  Project-URL: Homepage, https://github.com/OpenHands/software-agent-sdk
@@ -5,9 +5,9 @@ openhands/tools/apply_patch/core.py,sha256=6AbpBlXj2l49MrxElSA3MGMq28XcILAjfIa3M
5
5
  openhands/tools/apply_patch/definition.py,sha256=V5_Yp64eeTGUMTKLwPhv6IFswb051gj9J4VZr-ulCjw,6374
6
6
  openhands/tools/browser_use/__init__.py,sha256=M8hf8hIjKZhgsxa186gw57t4cPg6JgHB9wyhMdEiA5Q,1547
7
7
  openhands/tools/browser_use/definition.py,sha256=dcd9L6pTQkLV-iGzne6Yr6KIDK4itHNmEeFlOq5t4TA,23696
8
- openhands/tools/browser_use/impl.py,sha256=Wl9_WHkTB35e_gFsC9nITsmKKTBMIvl46idUIQTXR4U,16085
8
+ openhands/tools/browser_use/impl.py,sha256=rOtylTGfzyuFBPbhaMxM2eOKIsej_RU9KYgCC-CRLOQ,16164
9
9
  openhands/tools/browser_use/impl_windows.py,sha256=elnYUrIAnlqTyiBptLiDNyQepvDrzx5CehLvnXJBNqg,2587
10
- openhands/tools/browser_use/logging_fix.py,sha256=6h5RhHnwL5wYo31ThuIqSA5-6hgFFELNSwAhOJkBw-I,1885
10
+ openhands/tools/browser_use/logging_fix.py,sha256=uw6a5wapn7el81Jrz_usIHYrzww0cKab_LFPYffLRTk,1885
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
@@ -27,7 +27,7 @@ openhands/tools/file_editor/utils/diff.py,sha256=x7R-U0CmVe2YsofAWDj5DbRKxS_k8zY
27
27
  openhands/tools/file_editor/utils/encoding.py,sha256=DvIaH9zXtW18q7sT0QKNSUdDkBEkK35GMuQ_8CH5bIc,4815
28
28
  openhands/tools/file_editor/utils/file_cache.py,sha256=mt7KzUib_1SevbvqyOdD2S6ZH0n-nJ11TjIXPWbKTZA,5624
29
29
  openhands/tools/file_editor/utils/history.py,sha256=d0SLY3UkG-O5O_kaXzC7HPT7mCAtDOFCImVZUhbC_Rk,4626
30
- openhands/tools/file_editor/utils/shell.py,sha256=M4pOQ0o6wclRAMRYvPNDu2dADtcmyiQX1BraXffqdWQ,2090
30
+ openhands/tools/file_editor/utils/shell.py,sha256=drWoOq4k8kfCXKKMm3VSlJDp1V3m7C6yy9DB3LFj4zw,2251
31
31
  openhands/tools/gemini/__init__.py,sha256=pQmI7yUOowmZ40EIIC3mYUwScqU0jXlL--AXr0cWQOI,2351
32
32
  openhands/tools/gemini/edit/__init__.py,sha256=eg_xnsVojupFu0Mt9TftrHfMMMO2k7CuuCpADDyKNqQ,279
33
33
  openhands/tools/gemini/edit/definition.py,sha256=azuNC14BUaaXeBkQh1w-B9BruB-2gGkIVOG19hE7KRM,5822
@@ -43,10 +43,10 @@ openhands/tools/gemini/write_file/definition.py,sha256=D1W7xw80aXxoO5Bh3pgkSc8Yl
43
43
  openhands/tools/gemini/write_file/impl.py,sha256=Mdo6OUY8IzDk2kpXP-TUdfFc8ilu6hRAA3dnu8U6gjA,3003
44
44
  openhands/tools/glob/__init__.py,sha256=4Idgu57kPzZ3xDjKvpBfDEPQ2Z38Xtf2IyXr4A06Z7M,265
45
45
  openhands/tools/glob/definition.py,sha256=sAIGoExf0-ObwBuajoURx9KsUrUGfkSP8LwxrHk0D5w,3743
46
- openhands/tools/glob/impl.py,sha256=HIntuPkCF79aNDqeTU5Q6fNaFhx2WjjnZPiwMERDcSY,10072
46
+ openhands/tools/glob/impl.py,sha256=cwBIXdVbQK1h7FUNVoysTsQH_ld_WDGZ-S6JC5lG_hY,10200
47
47
  openhands/tools/grep/__init__.py,sha256=XJscA-rP35sCCpILkcCF36sd_RG8XdTx6X3N12W7Obs,299
48
48
  openhands/tools/grep/definition.py,sha256=Nok-GtLv39a93y6s6BnJdL6nRERpPvk9LVX30lg6yHA,3970
49
- openhands/tools/grep/impl.py,sha256=Krbnygmqpv0iKI7HsfzIukOLoCweRg1JNCXv14d7WC8,8437
49
+ openhands/tools/grep/impl.py,sha256=mCib7eZi_nKCOBFMWv5-d1jSz3N7VpGOVnAs3KDf3PY,8647
50
50
  openhands/tools/planning_file_editor/__init__.py,sha256=edIuvR5ZnEXXsYfRt8xbrq15Z6vtdUq4AMguuuk1grI,197
51
51
  openhands/tools/planning_file_editor/definition.py,sha256=7wzE1qXoengRq80MjDI-XbWhbPVYLU1lThFO9Mq14wg,3927
52
52
  openhands/tools/planning_file_editor/impl.py,sha256=W8Mdy7Qjbz90iKSmisw23-TcFtXwe7Vk373WvrScCS8,2218
@@ -63,18 +63,18 @@ openhands/tools/terminal/definition.py,sha256=XggCv3uXMVUPHKTxv4RNPf2Bs2OOn0DLON
63
63
  openhands/tools/terminal/impl.py,sha256=l3A_28KYvEjEHX6YxcHS40vHKKa2cXvmvU_1a7_YM84,7378
64
64
  openhands/tools/terminal/metadata.py,sha256=0olTMMt70eYPsROwmR6CrQMHWH77UQum54RUa2zk6bA,3593
65
65
  openhands/tools/terminal/terminal/__init__.py,sha256=UL08nepNd-k4jWBglQAKtg4aPjgNfH_71hsZjNEB7hw,665
66
- openhands/tools/terminal/terminal/factory.py,sha256=9yjBU473_syYCQBZHSyDxhZL04DnSGG0slTXcCKEA20,4363
66
+ openhands/tools/terminal/terminal/factory.py,sha256=Q9w-6AV-2aRpcTrKotdDDEKq1_7zc7I0MFb3sxXU374,4475
67
67
  openhands/tools/terminal/terminal/interface.py,sha256=g0nyhMzVsIGptfBnBdv6FESUtv7k-EnRI32KYYl2VO0,6854
68
- openhands/tools/terminal/terminal/subprocess_terminal.py,sha256=zdSgjh4jo9aS-fseG0pfikDcF7QTHNbnr7OwtEQCEKA,16225
68
+ openhands/tools/terminal/terminal/subprocess_terminal.py,sha256=vKvcX_0H7ck3_BHWbir41NTI6srH4hCymOt48doq8js,16269
69
69
  openhands/tools/terminal/terminal/terminal_session.py,sha256=Y3n95JQfG_nid4g_j2873uVPjl-UQwiu3H3vwkijbrM,20159
70
- openhands/tools/terminal/terminal/tmux_terminal.py,sha256=_Z3CqwC8czTX_XKF6eBnTcs5Zi94ElX-iRfJ071VtTo,6113
70
+ openhands/tools/terminal/terminal/tmux_terminal.py,sha256=QMXeTs45WWeM6VzbHN3eCAYu9xXsHpFa6prsfNkOG3M,6187
71
71
  openhands/tools/terminal/utils/command.py,sha256=ZT6KMFQNIpMMWGKnG8HAlCJpaB34JcbYYfYBjcLNTQs,5434
72
72
  openhands/tools/tom_consult/__init__.py,sha256=av9VYJRWHmP4_5Eu2840PARtgOTRP84jZjqJ3zs8sRs,581
73
73
  openhands/tools/tom_consult/definition.py,sha256=MTdOCOJaEGgOXhlJ9-x0HdhD6JiKNT2DodEOdsB4RBg,8224
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.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,,
77
+ openhands_tools-1.10.0.dist-info/METADATA,sha256=7aBR3o2KlLBYrZxhtmkHxFhId6OPFw9fyUC6_5YJlKA,699
78
+ openhands_tools-1.10.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
79
+ openhands_tools-1.10.0.dist-info/top_level.txt,sha256=jHgVu9I0Blam8BXFgedoGKfglPF8XvW1TsJFIjcgP4E,10
80
+ openhands_tools-1.10.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5