Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(sandbox): `mount_dir` for ssh_box (#1333)

Xingyao Wange6ecbd55100c
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,