Skip to content

Commit a889388

Browse files
committed
ServerRuntime: config copy in init
1 parent 948b926 commit a889388

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

opendevin/runtime/server/runtime.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
from typing import Any, Optional
23

34
from opendevin.core.config import AppConfig
@@ -43,6 +44,7 @@ def __init__(
4344
plugins: list[PluginRequirement] | None = None,
4445
sandbox: Sandbox | None = None,
4546
):
47+
self.config = copy.deepcopy(config)
4648
super().__init__(config, event_stream, sid, plugins)
4749
self.file_store = LocalFileStore(config.workspace_base)
4850
if sandbox is None:

tests/unit/test_runtime.py

+3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ async def _load_runtime(
141141
runtime = ServerRuntime(
142142
config=config, event_stream=event_stream, sid=sid, plugins=plugins
143143
)
144+
assert (
145+
runtime.sandbox.run_as_devin == run_as_devin
146+
), f'run_as_devin in sandbox should be {run_as_devin}'
144147
await runtime.ainit()
145148
from opendevin.runtime.tools import (
146149
RuntimeTool, # deprecate this after ServerRuntime is deprecated

0 commit comments

Comments
 (0)