Skip to content

fix: override server_image default to None in DockerDevWorkspace#2243

Merged
simonrosenberg merged 1 commit intomainfrom
fix/docker-dev-workspace-server-image-default
Feb 28, 2026
Merged

fix: override server_image default to None in DockerDevWorkspace#2243
simonrosenberg merged 1 commit intomainfrom
fix/docker-dev-workspace-server-image-default

Conversation

@simonrosenberg
Copy link
Copy Markdown
Collaborator

@simonrosenberg simonrosenberg commented Feb 28, 2026

Summary

  • DockerDevWorkspace inherits server_image's default of "ghcr.io/openhands/agent-server:latest-python" from DockerWorkspace, causing the _validate_images validator to reject any instance constructed with only base_image (both fields are non-None).
  • Override the server_image field default to None in DockerDevWorkspace so callers can use base_image without needing to explicitly pass server_image=None.
  • This is the SDK-side fix for the workaround applied downstream in OpenHands/benchmarks@63cb3a1.

Fixes #2242

Breaking change note

DockerDevWorkspace() called without base_image previously inherited the parent's server_image default ("ghcr.io/openhands/agent-server:latest-python") and passed validation. After this change, it will raise a ValueError since both fields default to None.

This is unlikely to affect anyone in practice — using DockerDevWorkspace without base_image is not a meaningful use case (you'd use DockerWorkspace directly instead). All existing usages in the SDK and benchmarks repos pass base_image explicitly. The previous behavior was accidentally permissive, not intentional.

Test plan

  • Existing tests pass (test_docker_dev_workspace_has_build_fields, test_docker_dev_workspace_import, etc.)
  • DockerDevWorkspace(base_image="python:3.13") no longer raises a validation error
  • DockerDevWorkspace(server_image="ghcr.io/openhands/agent-server:latest") still works
  • DockerDevWorkspace() (neither field) raises a validation error as expected

🤖 Generated with Claude Code


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:e27b76e-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-e27b76e-python \
  ghcr.io/openhands/agent-server:e27b76e-python

All tags pushed for this build

ghcr.io/openhands/agent-server:e27b76e-golang-amd64
ghcr.io/openhands/agent-server:e27b76e-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:e27b76e-golang-arm64
ghcr.io/openhands/agent-server:e27b76e-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:e27b76e-java-amd64
ghcr.io/openhands/agent-server:e27b76e-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:e27b76e-java-arm64
ghcr.io/openhands/agent-server:e27b76e-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:e27b76e-python-amd64
ghcr.io/openhands/agent-server:e27b76e-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:e27b76e-python-arm64
ghcr.io/openhands/agent-server:e27b76e-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:e27b76e-golang
ghcr.io/openhands/agent-server:e27b76e-java
ghcr.io/openhands/agent-server:e27b76e-python

About Multi-Architecture Support

  • Each variant tag (e.g., e27b76e-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., e27b76e-python-amd64) are also available if needed

DockerDevWorkspace inherits server_image's default value of
"ghcr.io/openhands/agent-server:latest-python" from DockerWorkspace.
This causes the _validate_images validator to reject any instance
constructed with only base_image, since both fields are non-None.

Override the default to None so callers can simply pass base_image
without also needing to explicitly set server_image=None.

Fixes #2242

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

API breakage checks (Griffe)

Result: Failed

Log excerpt (first 1000 characters)

============================================================
Checking openhands-sdk (openhands.sdk)
============================================================
Comparing openhands-sdk 1.11.5 against 1.11.4
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): load_public_skills
No breaking changes detected

============================================================
Checking openhands-workspace (openhands.workspace)
============================================================
Comparing openhands-workspace 1.11.5 against 1.11.4
::warning file=openhands-workspace/openhands/workspace/docker/dev_workspace.py,line=33,title=DockerDevWorkspace.server_image::Attribute value was changed: `Field(default='ghcr.io/openhands/agent-server:latest-python', description='Pre-built agent server image to use.')` -> `Field(default=None, description='Pre-built agent server image. Mutually exclusive with base_image.')`
::error title=SemVer::Breaking changes detected (1); re

Action log

@github-actions
Copy link
Copy Markdown
Contributor

Agent server REST API breakage checks (OpenAPI)

Result: Passed

Action log

Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Good taste - Simple, elegant fix for a real problem. Overriding the inherited field default is the right approach here. LGTM!

@simonrosenberg simonrosenberg self-assigned this Feb 28, 2026
@simonrosenberg simonrosenberg merged commit bde715c into main Feb 28, 2026
30 checks passed
@simonrosenberg simonrosenberg deleted the fix/docker-dev-workspace-server-image-default branch February 28, 2026 10:16
@enyst
Copy link
Copy Markdown
Collaborator

enyst commented Feb 28, 2026

@simonrosenberg Please see the linked PR comment, the Griffe check for API breakages failed on this PR. The way we do this is to use deprecation mechanism for a few releases, before breaking changes. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DockerDevWorkspace inherits non-None server_image default, breaking base_image usage

3 participants