From 0eef3cd8a8bd2fd026160b5cbb33e4733e3262bc Mon Sep 17 00:00:00 2001 From: Lysenko Artem Date: Mon, 30 Mar 2026 18:57:59 +0200 Subject: [PATCH 1/2] Update overlayfs_manager.py --- sgr_agent_core/services/overlayfs_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgr_agent_core/services/overlayfs_manager.py b/sgr_agent_core/services/overlayfs_manager.py index a37a1f6c..be9af146 100644 --- a/sgr_agent_core/services/overlayfs_manager.py +++ b/sgr_agent_core/services/overlayfs_manager.py @@ -36,7 +36,7 @@ def _get_run_command_config_candidates(config: GlobalConfig) -> list[RunCommandT tool_config_dict = runcommand_def.tool_kwargs() candidates.append(RunCommandToolConfig(**tool_config_dict)) for agent_def in config.agents.values(): - _, tool_configs = AgentFactory._resolve_tools_with_configs(agent_def.tools, config) + _, tool_configs = AgentFactory._resolve_tools_with_configs(agent_def.tools) if "runcommandtool" in tool_configs: candidates.append(RunCommandToolConfig(**tool_configs["runcommandtool"])) return candidates From 73dae957a855904c49e17f454dbc792a4785fa96 Mon Sep 17 00:00:00 2001 From: Lysenko Artem Date: Mon, 30 Mar 2026 19:35:51 +0200 Subject: [PATCH 2/2] Update test_tools.py --- tests/test_tools.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_tools.py b/tests/test_tools.py index 9a48f7ef..3d7400b4 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -5,6 +5,7 @@ - Config reading (if needed) """ +import sys import tempfile from pathlib import Path from unittest.mock import AsyncMock, MagicMock, patch @@ -337,15 +338,18 @@ async def test_run_command_tool_unsafe_mode_runs_subprocess(self): @pytest.mark.asyncio async def test_run_command_tool_uses_workspace_path_as_cwd(self): - """RunCommandTool with workspace_path runs command with cwd set to - workspace_path.""" + """RunCommandTool with workspace_path runs subprocess with cwd set to + workspace_path (print cwd via same Python as test runner).""" from sgr_agent_core.models import AgentContext tmp = Path(__file__).resolve().parent - tool = RunCommandTool(reasoning="Test", command="pwd") + command = f'"{sys.executable}" -c "import os; print(os.getcwd())"' + tool = RunCommandTool(reasoning="Test", command=command) context = AgentContext() config = MagicMock() result = await tool(context, config, mode="unsafe", workspace_path=str(tmp)) + print(result) + print(tmp.name) assert tmp.name in result or str(tmp) in result @pytest.mark.asyncio