You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DockerDevWorkspace inherits server_image's default value of "ghcr.io/openhands/agent-server:latest-python" from its parent class DockerWorkspace. This means that constructing a DockerDevWorkspace with only base_image causes the _validate_images validator to fail, because both base_image and server_image are non-None.
# This fails with: "Exactly one of 'base_image' or 'server_image' must be set."DockerDevWorkspace(base_image="python:3.13", target="source")
Root Cause
In DockerWorkspace (openhands-workspace/openhands/workspace/docker/workspace.py):
DockerDevWorkspace (openhands-workspace/openhands/workspace/docker/dev_workspace.py) never overrides this default, so server_image is always non-None unless the caller explicitly passes server_image=None.
The validator then rejects the instance:
if (self.base_imageisNone) == (self.server_imageisNone):
raiseValueError("Exactly one of 'base_image' or 'server_image' must be set.")
Impact
Every downstream consumer using DockerDevWorkspace with base_image must pass server_image=None as a workaround. For example, OpenHands/benchmarks had to apply this fix: OpenHands/benchmarks@63cb3a1
Suggested Fix
Override the server_image field default in DockerDevWorkspace:
classDockerDevWorkspace(DockerWorkspace):
server_image: str|None=Field(
default=None,
description="Pre-built agent server image. Mutually exclusive with base_image.",
)
...
Activity
fix: override server_image default to None in DockerDevWorkspace