From 519a71f2e7a65c177ed6c3285dd0eae62163190c Mon Sep 17 00:00:00 2001 From: claude Date: Wed, 27 May 2026 13:07:15 -0400 Subject: [PATCH] refactor(docker): drop legacy names from capability_apply teardown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last of the per-sidecar legacy names. `_per_bottle_container_names` used to list the four pre-bundle sidecars (cred-proxy, pipelock, git-gate, supervise) so capability-apply's teardown would force-rm them on remediation. None of those containers exist anymore — the four daemons run in the sidecar bundle (PRD 0024), so the list collapses to the agent + the bundle. Integration test follows: the fake supervise-sidecar setup, which existed to give teardown an extra container to clean up, switches to a fake sidecar bundle with the current name. Co-Authored-By: Claude Opus 4.7 --- claude_bottle/backend/docker/capability_apply.py | 10 +++------- tests/integration/test_capability_apply.py | 7 +++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/claude_bottle/backend/docker/capability_apply.py b/claude_bottle/backend/docker/capability_apply.py index 1a8b96a..6b69dcd 100644 --- a/claude_bottle/backend/docker/capability_apply.py +++ b/claude_bottle/backend/docker/capability_apply.py @@ -43,6 +43,7 @@ from .bottle_state import ( transcript_snapshot_dir, write_per_bottle_dockerfile, ) +from .sidecar_bundle import sidecar_bundle_container_name # Agent home inside the container (per the repo Dockerfile's @@ -52,9 +53,7 @@ _AGENT_HOME_IN_CONTAINER = "/home/node" _AGENT_TRANSCRIPT_IN_CONTAINER = f"{_AGENT_HOME_IN_CONTAINER}/.claude" _AGENT_WORKSPACE_IN_CONTAINER = f"{_AGENT_HOME_IN_CONTAINER}/workspace" -# Per-bottle resource name patterns (mirroring prepare.py / -# the various sidecar modules). The agent container's name is the -# slug with no infix; sidecars carry an infix like cred-proxy. +# Per-bottle resource name patterns (mirroring prepare.py). def _agent_container_name(slug: str) -> str: return f"claude-bottle-{slug}" @@ -65,10 +64,7 @@ def _per_bottle_container_names(slug: str) -> list[str]: fine to include names that don't exist for a given bottle.""" return [ _agent_container_name(slug), - f"claude-bottle-cred-proxy-{slug}", - f"claude-bottle-pipelock-{slug}", - f"claude-bottle-git-gate-{slug}", - f"claude-bottle-supervise-{slug}", + sidecar_bundle_container_name(slug), ] diff --git a/tests/integration/test_capability_apply.py b/tests/integration/test_capability_apply.py index e45395c..02711cc 100644 --- a/tests/integration/test_capability_apply.py +++ b/tests/integration/test_capability_apply.py @@ -39,6 +39,9 @@ from claude_bottle.backend.docker.network import ( network_create_internal, network_remove, ) +from claude_bottle.backend.docker.sidecar_bundle import ( + sidecar_bundle_container_name, +) from tests._docker import skip_unless_docker @@ -101,9 +104,9 @@ class TestCapabilityApply(unittest.TestCase): capture_output=True, text=True, check=False, ) self.assertEqual(0, r.returncode, r.stderr) - # Also start a fake supervise sidecar so teardown has something + # Also start a fake sidecar bundle so teardown has something # extra to clean up (mirrors a real bottle's container set). - sidecar = f"claude-bottle-supervise-{self.slug}" + sidecar = sidecar_bundle_container_name(self.slug) subprocess.run( [ "docker", "run", "-d",