fix: path_append must not clobber login shell PATH
Seeding PATH in the env before bash -l caused /etc/profile to skip its default PATH setup, breaking standard commands. Move path_append to an inline export so the login shell establishes a proper base PATH first. Add regression test: ls still works when path_append is set. Made-with: Cursor
This commit is contained in:
@@ -28,3 +28,11 @@ async def test_exec_path_append():
|
||||
tool = ExecTool(path_append="/opt/custom/bin")
|
||||
result = await tool.execute(command="echo $PATH")
|
||||
assert "/opt/custom/bin" in result
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_exec_path_append_preserves_system_path():
|
||||
"""pathAppend must not clobber standard system paths."""
|
||||
tool = ExecTool(path_append="/opt/custom/bin")
|
||||
result = await tool.execute(command="ls /")
|
||||
assert "Exit code: 0" in result
|
||||
|
||||
Reference in New Issue
Block a user