Skip to content

Commit 9cf2b5b

Browse files
[FIX] Update SWEBenchSSHBox after global config was removed from sandbox in #2961 (#3014)
Co-authored-by: Xingyao Wang <[email protected]>
1 parent 3a21198 commit 9cf2b5b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

evaluation/swe_bench/swe_env_box.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from swebench.harness.constants import MAP_REPO_TO_TEST_FRAMEWORK
99
from swebench.harness.utils import get_test_directives
1010

11-
from opendevin.core.config import config
11+
from opendevin.core.config import SandboxConfig, config
1212
from opendevin.core.logger import opendevin_logger as logger
1313
from opendevin.runtime.docker.ssh_box import DockerSSHBox
1414
from opendevin.runtime.plugins import (
@@ -50,7 +50,19 @@ def __init__(
5050
# Need to run as root to use SWEBench container
5151
sid = f'swe_bench_{swe_instance_id}_' + str(uuid.uuid4())
5252
logger.info(f'===Using container image: {container_image}')
53-
super().__init__(container_image, timeout, sid)
53+
super().__init__(
54+
config=SandboxConfig(container_image=container_image, timeout=timeout),
55+
persist_sandbox=config.persist_sandbox,
56+
workspace_mount_path=config.workspace_mount_path,
57+
sandbox_workspace_dir=config.workspace_mount_path_in_sandbox,
58+
cache_dir=config.cache_dir,
59+
use_host_network=config.use_host_network,
60+
run_as_devin=config.run_as_devin,
61+
ssh_hostname=config.ssh_hostname,
62+
ssh_password=config.ssh_password,
63+
ssh_port=config.ssh_port,
64+
sid=sid,
65+
)
5466
self.init_plugins(sandbox_plugins)
5567

5668
exit_code, output = self.execute('mv ~/.bashrc ~/.bashrc.bak')

0 commit comments

Comments
 (0)