AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Fix `execute_python_file` workspace mount & Windows path formatting (#4996)
Sohrab Sarana758acef2cf1
diff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.pyindex 2403b2ba5d..fb4cb70ea6 100644--- a/autogpt/commands/execute_code.py+++ b/autogpt/commands/execute_code.py@@ -145,11 +145,14 @@ def execute_python_file(filename: str, agent: Agent) -> str:logger.debug(f"Running {file_path} in a {image_name} container...")container: DockerContainer = client.containers.run(image_name,- ["python", str(file_path.relative_to(agent.workspace.root))],+ [+ "python",+ file_path.relative_to(agent.workspace.root).as_posix(),+ ],volumes={agent.config.workspace_path: {"bind": "/workspace",- "mode": "ro",+ "mode": "rw",}},working_dir="/workspace",