Fix working_dir bug in local runtime (#10801)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Boxuan Li 2025-09-07 23:44:55 -07:00 committed by GitHub
parent 9960d11d08
commit af0ab5a9f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View File

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

View File

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

View File

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