OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: OpenHands always sets first volume in SANDBOX_VOLUMES as workspace

Open Dador opened this issue 8 months ago • 4 comments

Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).

  • [x] I have checked the existing issues.

Describe the bug and reproduction steps

Related to #8242

I want to mount a volume (for example, /data) without mounting the workspace. However, due to this code in core/config/utils.py line 302, OpenHands always sets the first volume as the workspace, and there is no option to disable this functionality.

OpenHands Installation

Docker command in README

OpenHands Version

latest (13ca75c8cbd72686b1a3bf4c6f325571aa5d4a1b)

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

Dador avatar May 07 '25 11:05 Dador

You're right, and it's because of backwards compatibility. Maybe we should just check the name too.

enyst avatar May 07 '25 11:05 enyst

Since I'm trying to understand this new feature myself, does this mean if you want to mount a read only volume but not set any workspace, you can't do that right now? Is that the issue?

mamoodi avatar May 08 '25 13:05 mamoodi

@mamoodi yes, that's the issue. More specifically, I want to mount any volume—not just read-only volumes—without mounting the workspace.

Dador avatar May 08 '25 14:05 Dador

The current backwards-compatible friendly behaviour should be thoroughly documented. I put the volumes in reverse order, assuming standard Docker volume spec behaviour, and was wondering why /workspace was pointing to my :ro data :-)

@Dador - mind sharing more on what your use-case for no /workspace is?

pcuci avatar May 17 '25 14:05 pcuci

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 23 '25 02:06 github-actions[bot]

@pcuci I wanted to mount a large folder with data for processing, but I don't want to copy the data to the workspace, and I also don't need to mount the workspace as a folder (performance is a bit worse in that case).

Dador avatar Jun 23 '25 06:06 Dador

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 24 '25 02:07 github-actions[bot]

@xingyaoww I vaguely recall some work being done on this. Is this resolved now?

mamoodi avatar Jul 24 '25 12:07 mamoodi

I believe it should already be resolved:

https://docs.all-hands.dev/usage/runtimes/docker#using-sandbox-volumes

You can now only mount folders to e.g., /data.

Feel free to re-open if this issue still persist

xingyaoww avatar Jul 24 '25 16:07 xingyaoww