openhands-workspace 1.60.0__tar.gz → 1.60.2__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 (23) hide show
  1. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/PKG-INFO +1 -1
  2. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/apptainer/workspace.py +21 -15
  3. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/docker/workspace.py +7 -1
  4. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands_workspace.egg-info/PKG-INFO +1 -1
  5. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/pyproject.toml +1 -1
  6. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/__init__.py +0 -0
  7. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/agent_sandbox/__init__.py +0 -0
  8. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/agent_sandbox/testing/agent_ollama_example.py +0 -0
  9. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/agent_sandbox/testing/smoke_test.py +0 -0
  10. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/agent_sandbox/workspace.py +0 -0
  11. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/apptainer/__init__.py +0 -0
  12. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/cloud/__init__.py +0 -0
  13. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/cloud/workspace.py +0 -0
  14. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/docker/__init__.py +0 -0
  15. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/docker/dev_workspace.py +0 -0
  16. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/py.typed +0 -0
  17. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/remote_api/__init__.py +0 -0
  18. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands/workspace/remote_api/workspace.py +0 -0
  19. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands_workspace.egg-info/SOURCES.txt +0 -0
  20. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands_workspace.egg-info/dependency_links.txt +0 -0
  21. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands_workspace.egg-info/requires.txt +0 -0
  22. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/openhands_workspace.egg-info/top_level.txt +0 -0
  23. {openhands_workspace-1.60.0 → openhands_workspace-1.60.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openhands-workspace
3
- Version: 1.60.0
3
+ Version: 1.60.2
4
4
  Summary: OpenHands Workspace - Docker and container-based workspace implementations
5
5
  Project-URL: Source, https://github.com/OpenHands/software-agent-sdk
6
6
  Project-URL: Homepage, https://github.com/OpenHands/software-agent-sdk
@@ -200,21 +200,27 @@ class ApptainerWorkspace(RemoteWorkspace):
200
200
 
201
201
  # Run container
202
202
  self._instance_name = f"agent-server-{uuid.uuid4()}"
203
- self._start_container()
204
-
205
- # Set host for RemoteWorkspace to use
206
- object.__setattr__(self, "host", f"http://localhost:{self.host_port}")
207
- # Apptainer inherits SESSION_API_KEY from environment by default
208
- # We need to match it if present
209
- session_api_key = os.environ.get("SESSION_API_KEY")
210
- object.__setattr__(self, "api_key", session_api_key)
211
-
212
- # Wait for container to be healthy
213
- self._wait_for_health(timeout=self.health_check_timeout)
214
- logger.info("Apptainer workspace is ready at %s", self.host)
215
-
216
- # Now initialize the parent RemoteWorkspace with the container URL
217
- super().model_post_init(context)
203
+ try:
204
+ self._start_container()
205
+
206
+ # Set host for RemoteWorkspace to use
207
+ object.__setattr__(self, "host", f"http://localhost:{self.host_port}")
208
+ # Apptainer inherits SESSION_API_KEY from environment by default
209
+ # We need to match it if present
210
+ session_api_key = os.environ.get("SESSION_API_KEY")
211
+ object.__setattr__(self, "api_key", session_api_key)
212
+
213
+ # Wait for container to be healthy
214
+ self._wait_for_health(timeout=self.health_check_timeout)
215
+ logger.info("Apptainer workspace is ready at %s", self.host)
216
+
217
+ # Now initialize the parent RemoteWorkspace with the container URL
218
+ super().model_post_init(context)
219
+ except BaseException:
220
+ # A failed startup never returns a workspace to clean up, so stop
221
+ # the `apptainer run` process that may already be running.
222
+ self.cleanup()
223
+ raise
218
224
 
219
225
  def _prepare_sif_image(self) -> str:
220
226
  """Prepare the SIF image file from server_image."""
@@ -153,7 +153,13 @@ class DockerWorkspace(RemoteWorkspace):
153
153
  # Subclasses should call get_image() to get the image to use
154
154
  # This allows them to build or prepare the image before container startup
155
155
  image = self.get_image()
156
- self._start_container(image, context)
156
+ try:
157
+ self._start_container(image, context)
158
+ except BaseException:
159
+ # A failed startup never returns a workspace to clean up, so stop
160
+ # the container `docker run` may already have started.
161
+ self.cleanup()
162
+ raise
157
163
 
158
164
  def get_image(self) -> str:
159
165
  """Get the Docker image to use for the container.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openhands-workspace
3
- Version: 1.60.0
3
+ Version: 1.60.2
4
4
  Summary: OpenHands Workspace - Docker and container-based workspace implementations
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-workspace"
3
- version = "1.60.0"
3
+ version = "1.60.2"
4
4
  description = "OpenHands Workspace - Docker and container-based workspace implementations"
5
5
 
6
6
  requires-python = ">=3.12"