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

local sandbox: Create workspace base during init (#1377)

Boxuan Li 1 год назад
Родитель
Сommit
7d5856e36b

+ 6 - 0
.github/workflows/run-integration-tests.yml

@@ -48,6 +48,12 @@ jobs:
             agent: "CodeActAgent"
             embedding-model: "none"
             sandbox: "exec"
+          - name: MonologueAgent-py311-local
+            python-version: "3.11"
+            agent: "MonologueAgent"
+            embedding-model: "local"
+            # sufficient to have one agent testing against local sandbox
+            sandbox: "local"
     steps:
       - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}

+ 2 - 0
opendevin/sandbox/docker/local_box.py

@@ -1,5 +1,6 @@
 import subprocess
 import atexit
+import os
 from typing import Tuple, Dict
 from opendevin.sandbox.sandbox import Sandbox
 from opendevin.sandbox.process import Process
@@ -25,6 +26,7 @@ from opendevin.schema.config import ConfigType
 
 class LocalBox(Sandbox):
     def __init__(self, timeout: int = 120):
+        os.makedirs(config.get(ConfigType.WORKSPACE_BASE), exist_ok=True)
         self.timeout = timeout
         self.background_commands: Dict[int, Process] = {}
         self.cur_background_id = 0