refactor: remove leftovers from the orchestrator/gateway consolidation

Sweep for vestiges of the old combined-plane model and the pre-split shared
rootfs. Two are load-bearing, the rest are stale docs/comments:

- Bug: macOS `enumerate_active` only excluded the gateway container from the
  agent list, so after the split the orchestrator container
  (`bot-bottle-mac-orchestrator`, also `bot-bottle-`-prefixed) was enumerated as
  a phantom agent. Exclude both infra containers; test covers it.
- Dead code: the gateway `bootstrap.py` still carried an `orchestrator` daemon
  spec + `_OPT_IN_DAEMONS` + a signing-key/JWT env branch, all for the old
  combined container where the gateway process could also run the control plane.
  No backend ever requests it now — removed; the key-stripping stays as
  defense-in-depth.

Stale-comment reframes: "the/single infra container" -> the orchestrator +
gateway pair (or the specific plane); "shared rootfs / bb_role init / one
published rootfs" -> the per-plane rootfs + `role_init`; the deleted
Dockerfile.infra references in Dockerfile.orchestrator/.gateway; and the macOS
"one infra container ... same address" docstring + its now-false
share-one-address test (the planes are distinct containers with distinct
addresses).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 15:48:16 -04:00
parent d0d1da612e
commit cb2d778a8f
17 changed files with 103 additions and 124 deletions
+9 -9
View File
@@ -57,9 +57,11 @@ class TestEnsureGateway(unittest.TestCase):
def _service(self) -> MagicMock:
from bot_bottle.backend.macos_container.infra import InfraEndpoint
service = MagicMock()
# Two containers now: the orchestrator on the control network, the
# gateway on the agent network — distinct addresses.
service.ensure_running.return_value = InfraEndpoint(
orchestrator_url="http://192.168.128.2:8099",
gateway_ip="192.168.128.2",
gateway_ip="192.168.128.3",
)
service.network = "bot-bottle-mac-gateway"
service.ca_cert_pem.return_value = "PEM"
@@ -68,18 +70,16 @@ class TestEnsureGateway(unittest.TestCase):
def test_reports_gateway_endpoint(self) -> None:
endpoint = self._run(self._service())
self.assertEqual("http://192.168.128.2:8099", endpoint.orchestrator_url)
self.assertEqual("192.168.128.2", endpoint.gateway_ip)
self.assertEqual("192.168.128.3", endpoint.gateway_ip)
self.assertEqual("PEM", endpoint.gateway_ca_pem)
self.assertEqual("bot-bottle-mac-gateway", endpoint.network)
def test_orchestrator_and_gateway_share_one_address(self) -> None:
"""One infra container hosts both, so the gateway IP and the
control-plane host are the same."""
def test_gateway_ip_is_distinct_from_the_control_plane(self) -> None:
# The planes are separate containers, so the agent's proxy target (the
# gateway) is a different address from the control-plane host.
endpoint = self._run(self._service())
self.assertEqual(
endpoint.gateway_ip,
endpoint.orchestrator_url.split("://")[1].split(":")[0],
)
orch_host = endpoint.orchestrator_url.split("://")[1].split(":")[0]
self.assertNotEqual(orch_host, endpoint.gateway_ip)
class TestRegisterAgent(unittest.TestCase):