mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fix working_dir bug in local runtime (#10801)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
9960d11d08
commit
af0ab5a9f2
@ -139,7 +139,7 @@ async def run_controller(
|
||||
selected_repository=config.sandbox.selected_repo,
|
||||
repo_directory=repo_directory,
|
||||
conversation_instructions=conversation_instructions,
|
||||
working_dir=config.workspace_mount_path_in_sandbox,
|
||||
working_dir=str(runtime.workspace_root),
|
||||
)
|
||||
|
||||
# Add MCP tools to the agent
|
||||
|
||||
@ -443,6 +443,8 @@ def test_sandbox_volumes(monkeypatch, default_config):
|
||||
'SANDBOX_VOLUMES',
|
||||
'/host/path1:/container/path1,/host/path2:/container/path2:ro',
|
||||
)
|
||||
# Clear any existing workspace mount path to test default behavior
|
||||
monkeypatch.delenv('WORKSPACE_MOUNT_PATH_IN_SANDBOX', raising=False)
|
||||
|
||||
load_from_env(default_config, os.environ)
|
||||
finalize_config(default_config)
|
||||
@ -465,6 +467,8 @@ def test_sandbox_volumes(monkeypatch, default_config):
|
||||
def test_sandbox_volumes_with_mode(monkeypatch, default_config):
|
||||
# Test SANDBOX_VOLUMES with read-only mode (no explicit /workspace mount)
|
||||
monkeypatch.setenv('SANDBOX_VOLUMES', '/host/path1:/container/path1:ro')
|
||||
# Clear any existing workspace mount path to test default behavior
|
||||
monkeypatch.delenv('WORKSPACE_MOUNT_PATH_IN_SANDBOX', raising=False)
|
||||
|
||||
load_from_env(default_config, os.environ)
|
||||
finalize_config(default_config)
|
||||
|
||||
@ -27,6 +27,7 @@ class FakeEventStream:
|
||||
class FakeRuntime:
|
||||
def __init__(self):
|
||||
self.event_stream = FakeEventStream()
|
||||
self.workspace_root = '/workspace'
|
||||
|
||||
async def connect(self):
|
||||
return None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user