Skip to content

fix(workspace): retry a null pod_status like any unknown status - #6586

Merged
VascoSch92 merged 1 commit into
mainfrom
vasco/null-pod-status
Nov 7, 2026
Merged

VascoSch92 merged 1 commit into
mainfrom
vasco/null-pod-status

Conversation

@VascoSch92

@VascoSch92 VascoSch92 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

just fixing a bug


AGENT:

Why

APIRemoteWorkspace._wait_until_runtime_alive_once reads data.get("pod_status", "").lower(). The default only applies when the key is missing; when the runtime API sends "pod_status": null the value is None, .lower() raises AttributeError, and since the retry loop only retries RuntimeError, workspace startup fails on the first poll.

Summary

Issue Number

Part of #6348 (item: "a JSON null pod_status raises AttributeError instead of being retried like other unknown statuses").

How to Test

uv run pytest tests/workspace/test_api_remote_workspace.py

test_null_pod_status_is_retried fails on main (AttributeError: 'NoneType' object has no attribute 'lower') and passes here; the file passes (10).

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• 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-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime 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:39eb8ae-python

Run

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

All tags pushed for this build

ghcr.io/openhands/agent-server:39eb8ae-golang-amd64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-golang-amd64
ghcr.io/openhands/agent-server:vasco-null-pod-status-golang-amd64
ghcr.io/openhands/agent-server:39eb8ae-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:39eb8ae-golang-arm64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-golang-arm64
ghcr.io/openhands/agent-server:vasco-null-pod-status-golang-arm64
ghcr.io/openhands/agent-server:39eb8ae-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:39eb8ae-java-amd64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-java-amd64
ghcr.io/openhands/agent-server:vasco-null-pod-status-java-amd64
ghcr.io/openhands/agent-server:39eb8ae-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:39eb8ae-java-arm64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-java-arm64
ghcr.io/openhands/agent-server:vasco-null-pod-status-java-arm64
ghcr.io/openhands/agent-server:39eb8ae-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:39eb8ae-python-amd64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-amd64
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-amd64
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-amd64
ghcr.io/openhands/agent-server:39eb8ae-python-arm64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-arm64
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-arm64
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-arm64
ghcr.io/openhands/agent-server:39eb8ae-python-minimal-amd64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-minimal-amd64
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-minimal-amd64
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:39eb8ae-python-minimal-arm64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-minimal-arm64
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-minimal-arm64
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:39eb8ae-python-slim-amd64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-slim-amd64
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-slim-amd64
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:39eb8ae-python-slim-arm64
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-slim-arm64
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-slim-arm64
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:39eb8ae-golang
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-golang
ghcr.io/openhands/agent-server:vasco-null-pod-status-golang
ghcr.io/openhands/agent-server:39eb8ae-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:39eb8ae-java
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-java
ghcr.io/openhands/agent-server:vasco-null-pod-status-java
ghcr.io/openhands/agent-server:39eb8ae-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:39eb8ae-python-minimal
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-minimal
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-minimal
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-minimal
ghcr.io/openhands/agent-server:39eb8ae-python-slim
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python-slim
ghcr.io/openhands/agent-server:vasco-null-pod-status-python-slim
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime-slim
ghcr.io/openhands/agent-server:39eb8ae-python
ghcr.io/openhands/agent-server:39eb8ae1d201e53a57148ee9b51bb127152f2e04-python
ghcr.io/openhands/agent-server:vasco-null-pod-status-python
ghcr.io/openhands/agent-server:39eb8ae-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., 39eb8ae-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., 39eb8ae-python-amd64) are also available if needed

data.get("pod_status", "") returns None when the runtime API sends
"pod_status": null, so .lower() raised AttributeError and startup failed
instead of retrying. Treat null as an empty (unknown) status.
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-workspace/openhands/workspace/remote_api
   workspace.py2177964%128, 137–139, 143–144, 146–150, 152, 154–155, 159–160, 165–167, 169–182, 189, 212, 237, 290, 294, 300–302, 319–325, 329–330, 335–347, 350–351, 354–360, 363, 383, 387, 396, 415–416, 422
TOTAL535672656550% 

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This review was posted by an AI agent (OpenHands).

Scope: The change is in openhands-workspace/openhands/workspace/remote_api/workspace.py, owned by this repository. It fixes a tracked item from #6348 (issue is open, labeled bug / priority:medium / ready-for-dev) and correctly references it as "Part of #6348" per that tracker's instructions. No REST/OpenAPI/TypeScript-client surface is affected — this is internal error-handling around an HTTP poll.

Correctness: On main, data.get("pod_status", "") returns None for a JSON null (the default only applies when the key is missing), so .lower() raises AttributeError, which the tenacity retry loop (retrying only RuntimeError) does not catch — workspace startup fails on the first poll. The fix maps null to the existing "Unknown pod status" branch, raising RuntimeError so it is retried like any other unrecognized status. No non-null value changes behavior.

Verification in the workspace:

  • test_null_pod_status_is_retried fails on main's source with exactly AttributeError: 'NoneType' object has no attribute 'lower' and passes on this head — a real before/after reproduction of the reported bug.
  • uv run pytest tests/workspace/test_api_remote_workspace.py: 10 passed.
  • uv run pytest tests/workspace/: 253 passed.

CI on this exact head (39eb8ae): All checks pass, including sdk-tests, cross-tests, integration-test, pre-commit, and windows-tests. The single failing check, Build & Push (python-amd64), fails with a Docker registry infrastructure error (blob sha256:...: not found) during image build; this +14/−1 Python-only diff (one source line, one test) contains no Dockerfile, dependency, or packaging change, so the failure is unrelated to the PR.

No material correctness, security, compatibility, or acceptance-criterion defects found.

✅ APPROVED

@VascoSch92
VascoSch92 merged commit 2a25ed1 into main Nov 7, 2026
61 of 63 checks passed
@VascoSch92
VascoSch92 deleted the vasco/null-pod-status branch November 7, 2026 16:39
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.

2 participants