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

This commit is contained in:
Boxuan Li
2024-04-26 20:50:58 -07:00
committed by GitHub
parent fd9e598136
commit 7d5856e36b
2 changed files with 8 additions and 0 deletions

View File

@@ -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 }}

View File

@@ -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