refactor(docker): drop legacy names from capability_apply teardown
test / unit (pull_request) Successful in 21s
test / integration (pull_request) Successful in 40s

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 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 13:07:15 -04:00
parent 727f30d422
commit 519a71f2e7
2 changed files with 8 additions and 9 deletions
@@ -43,6 +43,7 @@ from .bottle_state import (
transcript_snapshot_dir, transcript_snapshot_dir,
write_per_bottle_dockerfile, write_per_bottle_dockerfile,
) )
from .sidecar_bundle import sidecar_bundle_container_name
# Agent home inside the container (per the repo Dockerfile's # 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_TRANSCRIPT_IN_CONTAINER = f"{_AGENT_HOME_IN_CONTAINER}/.claude"
_AGENT_WORKSPACE_IN_CONTAINER = f"{_AGENT_HOME_IN_CONTAINER}/workspace" _AGENT_WORKSPACE_IN_CONTAINER = f"{_AGENT_HOME_IN_CONTAINER}/workspace"
# Per-bottle resource name patterns (mirroring prepare.py / # 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.
def _agent_container_name(slug: str) -> str: def _agent_container_name(slug: str) -> str:
return f"claude-bottle-{slug}" 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.""" fine to include names that don't exist for a given bottle."""
return [ return [
_agent_container_name(slug), _agent_container_name(slug),
f"claude-bottle-cred-proxy-{slug}", sidecar_bundle_container_name(slug),
f"claude-bottle-pipelock-{slug}",
f"claude-bottle-git-gate-{slug}",
f"claude-bottle-supervise-{slug}",
] ]
+5 -2
View File
@@ -39,6 +39,9 @@ from claude_bottle.backend.docker.network import (
network_create_internal, network_create_internal,
network_remove, network_remove,
) )
from claude_bottle.backend.docker.sidecar_bundle import (
sidecar_bundle_container_name,
)
from tests._docker import skip_unless_docker from tests._docker import skip_unless_docker
@@ -101,9 +104,9 @@ class TestCapabilityApply(unittest.TestCase):
capture_output=True, text=True, check=False, capture_output=True, text=True, check=False,
) )
self.assertEqual(0, r.returncode, r.stderr) 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). # 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( subprocess.run(
[ [
"docker", "run", "-d", "docker", "run", "-d",