From e6ecbd55100c4d9307bf025f7ab8b598b20a77f3 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Thu, 25 Apr 2024 00:10:14 +0800 Subject: [PATCH] fix(sandbox): `mount_dir` for ssh_box (#1333) * fix mount_dir for ssh_box * move logic to config.py --- opendevin/config.py | 3 +++ opendevin/sandbox/docker/ssh_box.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opendevin/config.py b/opendevin/config.py index 39cf55f208..59d5354e20 100644 --- a/opendevin/config.py +++ b/opendevin/config.py @@ -134,6 +134,9 @@ def finalize_config(): parts = config[ConfigType.WORKSPACE_MOUNT_REWRITE].split(':') config[ConfigType.WORKSPACE_MOUNT_PATH] = base.replace(parts[0], parts[1]) + if config.get(ConfigType.WORKSPACE_MOUNT_PATH) is None: + config[ConfigType.WORKSPACE_MOUNT_PATH] = config.get(ConfigType.WORKSPACE_BASE) + finalize_config() diff --git a/opendevin/sandbox/docker/ssh_box.py b/opendevin/sandbox/docker/ssh_box.py index 8b58f73a7b..b498b7e964 100644 --- a/opendevin/sandbox/docker/ssh_box.py +++ b/opendevin/sandbox/docker/ssh_box.py @@ -373,8 +373,8 @@ class DockerSSHBox(Sandbox): ) ) - mount_dir = config.get('WORKSPACE_MOUNT_PATH') - print('Mounting workspace directory: ', mount_dir) + mount_dir = config.get(ConfigType.WORKSPACE_MOUNT_PATH) + logger.info(f'Mounting workspace directory: {mount_dir}') # start the container self.container = self.docker_client.containers.run( self.container_image,