Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions coding-agent/postmortem/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -590,3 +590,28 @@ patterns:
- and
- teardown
- idempotent
- id: PM-0024
title: Preserve cloud workspaces until cleanup is verified
path: patterns/PM-0024-preserve-cloud-workspaces-until-cleanup-is-verified.md
severity: medium
confidence: medium
subsystems:
- environment
- http
related_files:
- src/coding_agent/environment/docker_workspace_provider.py
- src/coding_agent/ui/http_server.py
- tests/coding_agent/environment/test_docker_workspace_provider.py
- tests/ui/test_http_server.py
related_commits: []
keywords:
- preserve
- cloud
- workspaces
- until
- cleanup
- verified
- rollback
- cancellation
- docker
- inspect
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
id: PM-0024
title: Preserve cloud workspaces until cleanup is verified
status: active
severity: medium
confidence: medium
subsystems:
- environment
- http
related_commits: []
related_files:
- src/coding_agent/environment/docker_workspace_provider.py
- src/coding_agent/ui/http_server.py
- tests/coding_agent/environment/test_docker_workspace_provider.py
- tests/ui/test_http_server.py
release_checks:
- Run focused cloud workspace rollback regressions in `tests/coding_agent/environment/test_docker_workspace_provider.py` and `tests/ui/test_http_server.py` before release.
- Review create-then-cleanup, cancellation, and external-subprocess verification paths before deleting host workspace state.
---

# Summary

Cloud workspace teardown must preserve host workspace state until container cleanup is known to have succeeded or the container is known to be absent.

# Trigger Conditions

- Changes in cloud workspace provisioning, rollback, Docker cleanup, HTTP session creation, or cancellation handling.
- Review feedback mentions leaked provisioned workspaces, skipped rollback on cancellation, or treating Docker inspect failures as missing containers.

# Known Fix Signals

- `src/coding_agent/environment/docker_workspace_provider.py`
- `src/coding_agent/ui/http_server.py`
- `tests/coding_agent/environment/test_docker_workspace_provider.py`
- `tests/ui/test_http_server.py`

# Release Review Checklist

- Run focused cloud workspace rollback regressions in `tests/coding_agent/environment/test_docker_workspace_provider.py` and `tests/ui/test_http_server.py` before release.
- Review create-then-cleanup, cancellation, and external-subprocess verification paths before deleting host workspace state.
6 changes: 6 additions & 0 deletions coding-agent/src/coding_agent/environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
from .docker_workspace_provider import DockerCloudWorkspaceClient
from .local import LocalEnvironment
from .workspace_provider import (
cleanup_cloud_binding_from_config,
CloudWorkspaceClientFactory,
CloudWorkspaceSource,
WorkspaceProvider,
cloud_client_factory_from_config,
provision_cloud_binding_from_config,
register_workspace_provider,
)

Expand All @@ -18,8 +21,11 @@
"CloudEnvironment",
"CloudWorkspaceClient",
"CloudWorkspaceClientFactory",
"CloudWorkspaceSource",
"cleanup_cloud_binding_from_config",
"LocalEnvironment",
"WorkspaceProvider",
"cloud_client_factory_from_config",
"provision_cloud_binding_from_config",
"register_workspace_provider",
]
Loading