openhands-agent-server 1.49.4__tar.gz → 1.49.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/PKG-INFO +1 -1
  2. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker/Dockerfile +46 -24
  3. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker_runtime/proxy.py +8 -1
  4. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker_runtime/registry.py +102 -0
  5. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker_runtime/routers.py +49 -6
  6. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands_agent_server.egg-info/PKG-INFO +1 -1
  7. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/pyproject.toml +1 -1
  8. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/__init__.py +0 -0
  9. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/__main__.py +0 -0
  10. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/_secret_redaction.py +0 -0
  11. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/_secrets_exposure.py +0 -0
  12. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/agent_profiles_router.py +0 -0
  13. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/api.py +0 -0
  14. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/auth_router.py +0 -0
  15. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/bash_router.py +0 -0
  16. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/bash_service.py +0 -0
  17. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/canvas_extensions/__init__.py +0 -0
  18. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/canvas_extensions/installed.py +0 -0
  19. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/canvas_extensions/manifest.py +0 -0
  20. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/canvas_extensions_router.py +0 -0
  21. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/config.py +0 -0
  22. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/conversation_lease.py +0 -0
  23. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/conversation_registry.py +0 -0
  24. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/conversation_router.py +0 -0
  25. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/conversation_service.py +0 -0
  26. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/credential_binding.py +0 -0
  27. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/dependencies.py +0 -0
  28. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker/build.py +0 -0
  29. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker_runtime/__init__.py +0 -0
  30. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker_runtime/mediation.py +0 -0
  31. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/docker_runtime/provisioning.py +0 -0
  32. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/env_parser.py +0 -0
  33. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/event_router.py +0 -0
  34. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/event_service.py +0 -0
  35. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/file_router.py +0 -0
  36. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/git_router.py +0 -0
  37. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/hooks_router.py +0 -0
  38. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/hooks_service.py +0 -0
  39. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/init_router.py +0 -0
  40. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/llm_router.py +0 -0
  41. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/local_secret_resolver.py +0 -0
  42. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/logging_config.py +0 -0
  43. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/mcp_oauth_store.py +0 -0
  44. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/mcp_router.py +0 -0
  45. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/middleware.py +0 -0
  46. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/models.py +0 -0
  47. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/openai/__init__.py +0 -0
  48. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/openai/models.py +0 -0
  49. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/openai/router.py +0 -0
  50. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/openai/service.py +0 -0
  51. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/openapi.py +0 -0
  52. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/persistence/__init__.py +0 -0
  53. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/persistence/models.py +0 -0
  54. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/persistence/store.py +0 -0
  55. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/plugins_router.py +0 -0
  56. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/plugins_service.py +0 -0
  57. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/profiles_router.py +0 -0
  58. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/provider_connections_router.py +0 -0
  59. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/pub_sub.py +0 -0
  60. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/py.typed +0 -0
  61. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/runtime_router.py +0 -0
  62. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/server_details_router.py +0 -0
  63. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/session_protocol.py +0 -0
  64. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/session_socket.py +0 -0
  65. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/settings_router.py +0 -0
  66. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/skills_router.py +0 -0
  67. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/skills_service.py +0 -0
  68. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/sockets.py +0 -0
  69. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/sub_agents_router.py +0 -0
  70. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/__init__.py +0 -0
  71. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/factory.py +0 -0
  72. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/http_exporter.py +0 -0
  73. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/models.py +0 -0
  74. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/policy.py +0 -0
  75. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/posthog_exporter.py +0 -0
  76. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/sanitizer.py +0 -0
  77. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/service.py +0 -0
  78. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/sink.py +0 -0
  79. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry/subscriber.py +0 -0
  80. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/telemetry_types.py +0 -0
  81. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/tool_preload_service.py +0 -0
  82. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/tool_router.py +0 -0
  83. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/utils.py +0 -0
  84. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/vscode_extensions/openhands-settings/extension.js +0 -0
  85. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/vscode_extensions/openhands-settings/package.json +0 -0
  86. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/vscode_router.py +0 -0
  87. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/vscode_service.py +0 -0
  88. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/workspace_router.py +0 -0
  89. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands/agent_server/workspaces_router.py +0 -0
  90. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands_agent_server.egg-info/SOURCES.txt +0 -0
  91. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands_agent_server.egg-info/dependency_links.txt +0 -0
  92. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands_agent_server.egg-info/entry_points.txt +0 -0
  93. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands_agent_server.egg-info/requires.txt +0 -0
  94. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/openhands_agent_server.egg-info/top_level.txt +0 -0
  95. {openhands_agent_server-1.49.4 → openhands_agent_server-1.49.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openhands-agent-server
3
- Version: 1.49.4
3
+ Version: 1.49.5
4
4
  Summary: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
5
5
  Project-URL: Source, https://github.com/OpenHands/software-agent-sdk
6
6
  Project-URL: Homepage, https://github.com/OpenHands/software-agent-sdk
@@ -8,6 +8,7 @@ ARG USERNAME=openhands
8
8
  ARG UID=10001
9
9
  ARG GID=10001
10
10
  ARG PORT=8000
11
+ ARG NPM_VERSION=11.19.1
11
12
  # Opt-in build flag for the Vertex AI extra (`openhands-sdk[vertex]`). Off by
12
13
  # default to keep the published image lean. Pass `--build-arg ENABLE_VERTEX=1`
13
14
  # to bundle google-cloud-aiplatform so the resulting binary supports
@@ -33,22 +34,24 @@ ARG INSTALL_CAPABILITIES=vscode,browser,docker
33
34
  # images. The final stage installs only the shared libraries required by Python
34
35
  # and Node; developer and package-manager tooling is added by the agent-server
35
36
  # stages below when needed. Package upgrades resolve against a dated snapshot so
36
- # newly published Debian packages have a seven-day observation period.
37
+ # newly published Debian packages have a three-day observation period.
37
38
  ####################################################################################
38
39
  FROM python:3.13.15-slim-trixie AS python-runtime
39
40
  FROM node:24.21.0-trixie-slim AS node-runtime
40
41
  FROM debian:trixie-slim AS python-node-runtime
41
- # Temporary exception to pick up Debian 13.7 before the normal observation period.
42
- ARG DEBIAN_SNAPSHOT=20260913T000000Z
42
+ ARG NPM_VERSION
43
+ ARG DEBIAN_SNAPSHOT=20260920T000000Z
43
44
 
44
45
  COPY --from=python-runtime /usr/local /usr/local
45
46
  COPY --from=node-runtime /usr/local/bin/node /usr/local/bin/node
46
47
  COPY --from=node-runtime /usr/local/lib/node_modules /usr/local/lib/node_modules
47
48
 
49
+ RUN node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --global "npm@${NPM_VERSION}"
50
+
48
51
  RUN set -eux; \
49
- ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm; \
50
- ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx; \
51
- ln -s ../lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack; \
52
+ ln -sfn ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm; \
53
+ ln -sfn ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx; \
54
+ ln -sfn ../lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack; \
52
55
  printf '%s\n' \
53
56
  'Types: deb' \
54
57
  "URIs: http://snapshot.debian.org/archive/debian/${DEBIAN_SNAPSHOT}/" \
@@ -112,9 +115,9 @@ ENV UV_PROJECT_ENVIRONMENT=/agent-server/.venv
112
115
  ENV UV_PYTHON_INSTALL_DIR=/agent-server/uv-managed-python
113
116
 
114
117
  # uv 0.11.5+ embeds python-build-standalone 20260408 metadata, which is the
115
- # first release with the PT_GNU_STACK fix. Pin to 0.11.6 (latest at time of
118
+ # first release with the PT_GNU_STACK fix. Pin to 0.12.15 (latest eligible at time of
116
119
  # writing) rather than :latest so builds are reproducible.
117
- COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /uvx /bin/
120
+ COPY --from=ghcr.io/astral-sh/uv:0.12.15 /uv /uvx /bin/
118
121
 
119
122
  RUN groupadd -g ${GID} ${USERNAME} \
120
123
  && useradd -m -u ${UID} -g ${GID} -s /usr/sbin/nologin ${USERNAME} \
@@ -174,6 +177,7 @@ RUN test -x /agent-server/dist/openhands-agent-server
174
177
  ####################################################################################
175
178
  FROM python:3.13-bookworm AS acp-providers
176
179
  ARG INSTALL_ACP_PROVIDERS
180
+ ARG NPM_VERSION
177
181
  # A fresh top-level path, not nested under a directory (e.g. /opt) that base
178
182
  # images commonly already populate (SWE-bench images ship /opt/miniconda3):
179
183
  # COPY --from=<stage> only produces a byte-identical layer across different
@@ -202,18 +206,19 @@ RUN set -eux; \
202
206
  rm -rf /var/lib/apt/lists/*; \
203
207
  ARCH=$(uname -m); \
204
208
  case "$ARCH" in \
205
- x86_64|amd64) NARCH=x64; NODE_SHA256=c0649af18e6a24f6fe5535a3e86b341dd49a8e71117c8b68bde973ef834f16f2;; \
206
- aarch64|arm64) NARCH=arm64; NODE_SHA256=0b2d9f564b6594222a62c82e1df2efe119dd4a4aff29644f4dd325bf360b6bcc;; \
209
+ x86_64|amd64) NARCH=x64; NODE_SHA256=d60acfe00a2932254bb0ad20e01b0d74397a0875595de719654b214f4b03f307;; \
210
+ aarch64|arm64) NARCH=arm64; NODE_SHA256=fff4078c5def658577f92c88db7db3bc0072924bfb93fe52c1e744a54e94abb8;; \
207
211
  *) echo "Unsupported architecture for ACP providers: '$ARCH'" >&2; exit 1;; \
208
212
  esac; \
209
- NODE_TARBALL="/tmp/node-v22.19.0-linux-${NARCH}.tar.xz"; \
213
+ NODE_TARBALL="/tmp/node-v22.23.2-linux-${NARCH}.tar.xz"; \
210
214
  curl -fsSL --retry 5 --retry-delay 2 --retry-connrefused \
211
- "https://nodejs.org/dist/v22.19.0/node-v22.19.0-linux-${NARCH}.tar.xz" -o "$NODE_TARBALL"; \
215
+ "https://nodejs.org/dist/v22.23.2/node-v22.23.2-linux-${NARCH}.tar.xz" -o "$NODE_TARBALL"; \
212
216
  echo "$NODE_SHA256 $NODE_TARBALL" | sha256sum -c -; \
213
217
  tar -xJ --strip-components=1 -C "$ACP_NODE_DIR" -f "$NODE_TARBALL"; \
214
218
  rm -f "$NODE_TARBALL"; \
215
219
  "$ACP_NODE_DIR/bin/node" --version; \
216
- PATH="$ACP_NODE_DIR/bin:$PATH" "$ACP_NODE_DIR/bin/npm" install -g $PACKAGES; \
220
+ PATH="$ACP_NODE_DIR/bin:$PATH" "$ACP_NODE_DIR/bin/npm" install --global "npm@${NPM_VERSION}"; \
221
+ PATH="$ACP_NODE_DIR/bin:$PATH" "$ACP_NODE_DIR/bin/npm" install --global $PACKAGES; \
217
222
  for bin in $WRAPPER_BINS; do \
218
223
  # Fail the build rather than ship a wrapper that execs a missing target:
219
224
  # a wrong binary_name is otherwise invisible until someone launches the
@@ -247,11 +252,11 @@ ENV OPENHANDS_BUILD_GIT_REF=${OPENHANDS_BUILD_GIT_REF}
247
252
  # Install base packages and create user
248
253
  RUN set -eux; \
249
254
  # Install base packages across the most common package managers, since
250
- # benchmark base images aren't always Debian-based. `tini` is added on
251
- # apt/apk where it's reliably available; on the other paths the kernel-
252
- # reaping behaviour falls back to dumb-init's absence (the agent server
253
- # is short-lived enough on non-Debian images that PID 1 zombie reaping
254
- # has not been observed to matter — revisit if it does).
255
+ # benchmark base images aren't always Debian-based. `tini` comes from the
256
+ # distro on apt/apk; the rpm/zypper families have no tini in their base
257
+ # repos, so those paths fall through to the static-binary install below.
258
+ # Every path must end with a working `tini` on PATH, because the ENTRYPOINT
259
+ # of this image invokes it unconditionally.
255
260
  if command -v apt-get >/dev/null 2>&1; then \
256
261
  apt-get -o Acquire::Retries=5 update; \
257
262
  apt-get -o Acquire::Retries=5 install -y --no-install-recommends \
@@ -260,22 +265,39 @@ RUN set -eux; \
260
265
  elif command -v apk >/dev/null 2>&1; then \
261
266
  apk add --no-cache bash ca-certificates git shadow tini tmux; \
262
267
  elif command -v microdnf >/dev/null 2>&1; then \
263
- microdnf install -y bash ca-certificates git shadow-utils tmux; \
268
+ microdnf install -y bash ca-certificates curl git shadow-utils tmux; \
264
269
  microdnf clean all; \
265
270
  elif command -v dnf >/dev/null 2>&1; then \
266
- dnf install -y bash ca-certificates git shadow-utils tmux; \
271
+ dnf install -y bash ca-certificates curl git shadow-utils tmux; \
267
272
  dnf clean all; \
268
273
  elif command -v yum >/dev/null 2>&1; then \
269
- yum install -y bash ca-certificates git shadow-utils tmux; \
274
+ yum install -y bash ca-certificates curl git shadow-utils tmux; \
270
275
  yum clean all; \
271
276
  elif command -v zypper >/dev/null 2>&1; then \
272
277
  zypper --non-interactive install --no-recommends \
273
- bash ca-certificates git shadow tmux; \
278
+ bash ca-certificates curl git shadow tmux; \
274
279
  zypper clean --all; \
275
280
  else \
276
281
  echo "Unsupported base image: no known package manager found" >&2; \
277
282
  exit 1; \
278
283
  fi; \
284
+ # Static tini fallback for the package managers that don't ship it. Pinned
285
+ # to a release-published sha256 per arch, mirroring the Node payload above.
286
+ if ! command -v tini >/dev/null 2>&1; then \
287
+ ARCH=$(uname -m); \
288
+ case "$ARCH" in \
289
+ x86_64|amd64) TARCH=amd64; TINI_SHA256=c5b0666b4cb676901f90dfcb37106783c5fe2077b04590973b885950611b30ee;; \
290
+ aarch64|arm64) TARCH=arm64; TINI_SHA256=eae1d3aa50c48fb23b8cbdf4e369d0910dfc538566bfd09df89a774aa84a48b9;; \
291
+ *) echo "Unsupported architecture for tini: '$ARCH'" >&2; exit 1;; \
292
+ esac; \
293
+ curl -fsSL --retry 5 --retry-delay 2 --retry-connrefused \
294
+ "https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-${TARCH}" \
295
+ -o /usr/local/bin/tini; \
296
+ echo "$TINI_SHA256 /usr/local/bin/tini" | sha256sum -c -; \
297
+ chmod 755 /usr/local/bin/tini; \
298
+ fi; \
299
+ # Fail the build rather than ship an image whose ENTRYPOINT cannot exec.
300
+ tini --version; \
279
301
  grep -Eq "^[^:]*:[^:]*:${GID}:" /etc/group || groupadd -g "${GID}" "${USERNAME}"; \
280
302
  grep -Eq "^${USERNAME}:" /etc/passwd || \
281
303
  useradd -m -u "${UID}" -g "${GID}" -s /bin/bash "${USERNAME}"; \
@@ -378,7 +400,7 @@ RUN set -eux; \
378
400
  echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
379
401
 
380
402
  # Keep uv as part of the full development environment, but not binary-minimal.
381
- COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /uvx /bin/
403
+ COPY --from=ghcr.io/astral-sh/uv:0.12.15 /uv /uvx /bin/
382
404
 
383
405
  # Fail fast on a typo'd capability name before spending any time on the
384
406
  # installs below (each block only checks for ITS OWN keyword's presence, so
@@ -401,7 +423,7 @@ ENV EDITOR=code \
401
423
  VISUAL=code \
402
424
  GIT_EDITOR="code --wait" \
403
425
  OPENVSCODE_SERVER_ROOT=/openhands/.openvscode-server
404
- ARG RELEASE_TAG="openvscode-server-v1.98.2"
426
+ ARG RELEASE_TAG="openvscode-server-v1.109.5"
405
427
  ARG RELEASE_ORG="gitpod-io"
406
428
  # The --mount=from=builder on the extensions RUN below is unconditional at
407
429
  # the Dockerfile level, so BuildKit still builds the full `builder` stage
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import asyncio
6
- from collections.abc import AsyncIterator
6
+ from collections.abc import AsyncIterator, Awaitable, Callable
7
7
  from contextlib import AsyncExitStack
8
8
  from typing import Protocol
9
9
  from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
@@ -81,6 +81,7 @@ async def proxy_http(
81
81
  upstream_path: str,
82
82
  timeout: float | None = None,
83
83
  body: bytes | None = None,
84
+ on_close: Callable[[], Awaitable[None]] | None = None,
84
85
  ) -> StreamingResponse:
85
86
  """Forward ``request`` to the per-conversation container.
86
87
 
@@ -94,6 +95,10 @@ async def proxy_http(
94
95
  timeout: Per-request timeout in seconds. ``None`` (the default) means
95
96
  no read timeout — conversation event streams can be long-lived.
96
97
  body: Replacement request body. By default the incoming body is streamed.
98
+ on_close: Awaited once the streamed response is fully consumed or the
99
+ client disconnects. Callers use this to release a session
100
+ attachment that must outlive the route handler (see
101
+ ``DockerConversationRegistry.attach_session``).
97
102
 
98
103
  Notes:
99
104
  A fresh :class:`httpx.AsyncClient` is created per request. We avoid a
@@ -149,6 +154,8 @@ async def proxy_http(
149
154
  yield chunk
150
155
  finally:
151
156
  await stack.aclose()
157
+ if on_close is not None:
158
+ await on_close()
152
159
 
153
160
  return StreamingResponse(
154
161
  _response_body(),
@@ -7,6 +7,7 @@ import hashlib
7
7
  import os
8
8
  import subprocess
9
9
  import time
10
+ from contextlib import suppress
10
11
  from dataclasses import dataclass
11
12
  from pathlib import Path
12
13
  from typing import TYPE_CHECKING
@@ -22,6 +23,7 @@ from openhands.agent_server.models import (
22
23
  ConversationRuntimeStatus,
23
24
  )
24
25
  from openhands.agent_server.persistence.store import _get_persistence_dir
26
+ from openhands.sdk.conversation.state import ConversationExecutionStatus
25
27
  from openhands.sdk.logger import get_logger
26
28
  from openhands.sdk.utils.cipher import Cipher
27
29
  from openhands.sdk.utils.command import execute_command, sanitized_env
@@ -74,8 +76,13 @@ class DockerConversationRegistry(ConversationRegistry):
74
76
  self._starts: dict[UUID, asyncio.Task[ConversationContainer]] = {}
75
77
  self._deleting: set[UUID] = set()
76
78
  self._lock = asyncio.Lock()
79
+ self._service: ConversationService | None = None
80
+ self._last_access: dict[UUID, float] = {}
81
+ self._sessions: dict[UUID, int] = {}
82
+ self._eviction_task: asyncio.Task[None] | None = None
77
83
 
78
84
  def configure_service(self, service: ConversationService) -> None:
85
+ self._service = service
79
86
  service.runtime_cipher_resolver = self.resolve_persisted_cipher
80
87
 
81
88
  def resolve_persisted_cipher(self, conversation_id: UUID) -> Cipher:
@@ -112,6 +119,8 @@ class DockerConversationRegistry(ConversationRegistry):
112
119
 
113
120
  async def start(self) -> None:
114
121
  await asyncio.to_thread(self.cleanup_stale_containers)
122
+ if self.config.conversation_idle_ttl_seconds:
123
+ self._eviction_task = asyncio.create_task(self._evict_idle_runtimes_loop())
115
124
 
116
125
  def add_execution_routes(self, router: APIRouter) -> None:
117
126
  from openhands.agent_server.docker_runtime.routers import (
@@ -164,6 +173,29 @@ class DockerConversationRegistry(ConversationRegistry):
164
173
  def is_starting(self, conversation_id: UUID) -> bool:
165
174
  return conversation_id in self._starts
166
175
 
176
+ def attach_session(self, conversation_id: UUID) -> None:
177
+ """Record an outer proxied session attached to this runtime.
178
+
179
+ Non-zero counts suppress idle eviction, mirroring the inner
180
+ ``EventService.has_external_subscribers()`` guard: a client holding a
181
+ live events websocket or a long-lived proxied stream keeps the
182
+ container alive even while the conversation itself looks idle.
183
+ """
184
+ self._sessions[conversation_id] = self._sessions.get(conversation_id, 0) + 1
185
+
186
+ def detach_session(self, conversation_id: UUID) -> None:
187
+ """Release a session recorded by :meth:`attach_session`."""
188
+ remaining = self._sessions.get(conversation_id, 0) - 1
189
+ if remaining > 0:
190
+ self._sessions[conversation_id] = remaining
191
+ else:
192
+ self._sessions.pop(conversation_id, None)
193
+ self._last_access[conversation_id] = time.monotonic()
194
+
195
+ def has_attached_sessions(self, conversation_id: UUID) -> bool:
196
+ """True if an outer proxied session is currently attached."""
197
+ return self._sessions.get(conversation_id, 0) > 0
198
+
167
199
  def cleanup_stale_containers(self) -> None:
168
200
  result = execute_command(
169
201
  ["docker", "ps", "-aq", "--filter", f"label={_OWNER_LABEL}={self.owner}"]
@@ -179,6 +211,7 @@ class DockerConversationRegistry(ConversationRegistry):
179
211
  async with self._lock:
180
212
  if conversation_id in self._deleting:
181
213
  raise RuntimeError("Conversation is being deleted")
214
+ self._last_access[conversation_id] = time.monotonic()
182
215
  container = self._containers.get(conversation_id)
183
216
 
184
217
  if container is not None:
@@ -211,12 +244,14 @@ class DockerConversationRegistry(ConversationRegistry):
211
244
  if existing is not None:
212
245
  if existing is not container:
213
246
  await asyncio.to_thread(container.stop)
247
+ self._last_access[conversation_id] = time.monotonic()
214
248
  return existing
215
249
  if self._starts.get(conversation_id) is not task:
216
250
  await asyncio.to_thread(container.stop)
217
251
  raise RuntimeError("Conversation container start was cancelled")
218
252
  self._starts.pop(conversation_id, None)
219
253
  self._containers[conversation_id] = container
254
+ self._last_access[conversation_id] = time.monotonic()
220
255
  return container
221
256
 
222
257
  async def begin_delete(self, conversation_id: UUID) -> bool:
@@ -234,6 +269,8 @@ class DockerConversationRegistry(ConversationRegistry):
234
269
  async with self._lock:
235
270
  task = self._starts.pop(conversation_id, None)
236
271
  container = self._containers.pop(conversation_id, None)
272
+ self._last_access.pop(conversation_id, None)
273
+ self._sessions.pop(conversation_id, None)
237
274
  if task is not None:
238
275
  try:
239
276
  started = await task
@@ -244,9 +281,74 @@ class DockerConversationRegistry(ConversationRegistry):
244
281
  await asyncio.to_thread(container.stop)
245
282
 
246
283
  async def shutdown(self) -> None:
284
+ if self._eviction_task is not None:
285
+ self._eviction_task.cancel()
286
+ with suppress(asyncio.CancelledError):
287
+ await self._eviction_task
288
+ self._eviction_task = None
247
289
  ids = set(self._containers) | set(self._starts)
248
290
  await asyncio.gather(*(self.stop(cid) for cid in ids), return_exceptions=True)
249
291
 
292
+ async def _evict_idle_runtimes_loop(self) -> None:
293
+ ttl = self.config.conversation_idle_ttl_seconds
294
+ if not ttl:
295
+ return
296
+ interval = max(1.0, min(60.0, ttl / 2))
297
+ while True:
298
+ await asyncio.sleep(interval)
299
+ try:
300
+ await self._evict_idle_runtimes(ttl)
301
+ except Exception:
302
+ logger.exception("error_evicting_idle_docker_runtimes")
303
+
304
+ async def _evict_idle_runtimes(self, ttl_seconds: float) -> None:
305
+ service = self._service
306
+ if service is None:
307
+ return
308
+ cutoff = time.monotonic() - ttl_seconds
309
+ async with self._lock:
310
+ candidates = [
311
+ (conversation_id, container)
312
+ for conversation_id, container in self._containers.items()
313
+ if self._last_access.get(conversation_id, float("inf")) <= cutoff
314
+ and not self.has_attached_sessions(conversation_id)
315
+ ]
316
+
317
+ for conversation_id, container in candidates:
318
+ info = await service.get_conversation(conversation_id)
319
+ if (
320
+ info is None
321
+ or info.execution_status == ConversationExecutionStatus.RUNNING
322
+ ):
323
+ continue
324
+ async with self._lock:
325
+ if self._containers.get(conversation_id) is not container:
326
+ continue
327
+ if self._last_access.get(conversation_id, float("inf")) > cutoff:
328
+ continue
329
+ if self.has_attached_sessions(conversation_id):
330
+ continue
331
+ self._containers.pop(conversation_id)
332
+ self._last_access.pop(conversation_id, None)
333
+ try:
334
+ await asyncio.to_thread(container.stop)
335
+ except Exception:
336
+ async with self._lock:
337
+ if conversation_id not in self._containers:
338
+ self._containers[conversation_id] = container
339
+ self._last_access[conversation_id] = time.monotonic()
340
+ logger.warning(
341
+ "Failed to stop idle conversation runtime %s",
342
+ conversation_id,
343
+ exc_info=True,
344
+ )
345
+ else:
346
+ logger.info(
347
+ "Stopped idle conversation runtime %s (idle >= %.0fs)",
348
+ conversation_id,
349
+ ttl_seconds,
350
+ )
351
+
250
352
  def _build_container(self, conversation_id: UUID) -> ConversationContainer:
251
353
  identity = self.provisioning.load(conversation_id)
252
354
  runtime_dir = self.provisioning.runtime_dir(conversation_id)
@@ -64,6 +64,39 @@ def _upstream_path(request: Request, path: str) -> str:
64
64
  return f"{path}?{query}" if query else path
65
65
 
66
66
 
67
+ async def _proxy_with_session(
68
+ registry: DockerConversationRegistry,
69
+ conversation_id: UUID,
70
+ container: ConversationContainer,
71
+ request: Request,
72
+ *,
73
+ upstream_path: str,
74
+ body: bytes | None = None,
75
+ ) -> StreamingResponse:
76
+ """Proxy one request while holding an outer session attachment.
77
+
78
+ The attachment is released when the streamed response finishes (or the
79
+ client disconnects), so a long-lived proxied stream keeps the container
80
+ from being evicted while a client is still reading from it.
81
+ """
82
+ registry.attach_session(conversation_id)
83
+
84
+ async def detach() -> None:
85
+ registry.detach_session(conversation_id)
86
+
87
+ try:
88
+ return await proxy_http(
89
+ request,
90
+ container,
91
+ upstream_path=upstream_path,
92
+ body=body,
93
+ on_close=detach,
94
+ )
95
+ except BaseException:
96
+ await detach()
97
+ raise
98
+
99
+
67
100
  docker_conversation_router = APIRouter(
68
101
  prefix="/conversations", tags=["Docker Conversations"]
69
102
  )
@@ -269,16 +302,20 @@ async def proxy_conversation(
269
302
  body = UpdateSecretsRequest(secrets=materialized).model_dump(
270
303
  mode="json", context={"expose_secrets": "plaintext"}
271
304
  )
272
- response = await proxy_http(
273
- request,
305
+ response = await _proxy_with_session(
306
+ registry,
307
+ conversation_id,
274
308
  container,
309
+ request,
275
310
  upstream_path=upstream_path,
276
311
  body=json.dumps(body).encode(),
277
312
  )
278
313
  else:
279
- response = await proxy_http(
280
- request,
314
+ response = await _proxy_with_session(
315
+ registry,
316
+ conversation_id,
281
317
  container,
318
+ request,
282
319
  upstream_path=upstream_path,
283
320
  )
284
321
  if request.method not in {"GET", "HEAD", "OPTIONS"} and response.status_code < 400:
@@ -297,9 +334,11 @@ async def proxy_workspace_file(
297
334
  ) -> StreamingResponse:
298
335
  registry = get_registry(request)
299
336
  container = await _container(registry, conversation_id)
300
- return await proxy_http(
301
- request,
337
+ return await _proxy_with_session(
338
+ registry,
339
+ conversation_id,
302
340
  container,
341
+ request,
303
342
  upstream_path=_upstream_path(
304
343
  request, f"/api/conversations/{conversation_id}/workspace/{file_path}"
305
344
  ),
@@ -331,6 +370,9 @@ async def _proxy_socket(
331
370
  return
332
371
  query = strip_auth_query("?" + websocket.url.query).lstrip("?")
333
372
  path = f"/sockets/{socket_name}/{conversation_id}"
373
+ # Hold the attachment for the whole bridge lifetime so the idle-eviction
374
+ # loop cannot stop the container under a live events/session websocket.
375
+ registry.attach_session(conversation_id)
334
376
  try:
335
377
  await bridge_websocket(
336
378
  websocket,
@@ -338,6 +380,7 @@ async def _proxy_socket(
338
380
  upstream_path=f"{path}?{query}" if query else path,
339
381
  )
340
382
  finally:
383
+ registry.detach_session(conversation_id)
341
384
  await websocket.app.state.conversation_service.refresh_persisted_conversation(
342
385
  conversation_id
343
386
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openhands-agent-server
3
- Version: 1.49.4
3
+ Version: 1.49.5
4
4
  Summary: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
5
5
  Project-URL: Source, https://github.com/OpenHands/software-agent-sdk
6
6
  Project-URL: Homepage, https://github.com/OpenHands/software-agent-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "openhands-agent-server"
3
- version = "1.49.4"
3
+ version = "1.49.5"
4
4
  description = "OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent"
5
5
 
6
6
  requires-python = ">=3.12"