Allow workspace_mount_path to use relative paths (#9615)

Co-authored-by: jianchuanli <jianchuanli@langcode.com>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
This commit is contained in:
mindflow-cn
2025-07-08 21:47:28 +08:00
committed by GitHub
parent 37cbeb735f
commit 7acee9e5da

View File

@@ -261,7 +261,8 @@ class DockerRuntime(ActionExecutionClient):
mount_mode = 'rw' # Default mode
# e.g. result would be: {"/home/user/openhands/workspace": {'bind': "/workspace", 'mode': 'rw'}}
volumes[self.config.workspace_mount_path] = {
# Add os.path.abspath() here so that relative paths can be used when workspace_mount_path is configured in config.toml
volumes[os.path.abspath(self.config.workspace_mount_path)] = {
'bind': self.config.workspace_mount_path_in_sandbox,
'mode': mount_mode,
}