test: cover exec login default public path

maintainer edit: add a regression test for the public ExecTool.execute path so omitted login stays non-login by default, and update the Unix environment docstring to match the new explicit login behavior.
This commit is contained in:
chengyongru
2026-06-27 11:04:31 +08:00
committed by Xubin Ren
parent 4c1f127549
commit 8656549129
2 changed files with 26 additions and 2 deletions
+3 -2
View File
@@ -541,8 +541,9 @@ class ExecTool(Tool):
def _build_env(self) -> dict[str, str]:
"""Build a minimal environment for subprocess execution.
On Unix, only HOME/LANG/TERM are passed; ``bash -l`` sources the
user's profile which sets PATH and other essentials.
On Unix, only HOME/LANG/TERM are passed by default. If callers request
``login=True``, bash/zsh may source the user's profile and add PATH or
other variables.
On Windows, ``cmd.exe`` has no login-profile mechanism, so a curated
set of system variables (including PATH) is forwarded. API keys and