Просмотр исходного кода

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

* fix mount_dir for ssh_box

* move logic to config.py
Xingyao Wang 1 год назад
Родитель
Сommit
e6ecbd5510
2 измененных файлов с 5 добавлено и 2 удалено
  1. 3 0
      opendevin/config.py
  2. 2 2
      opendevin/sandbox/docker/ssh_box.py

+ 3 - 0
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()
 

+ 2 - 2
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,