From 44479f328e4c2e99806799f9b48b19ab9f2d5de0 Mon Sep 17 00:00:00 2001 From: didericis Date: Mon, 20 Jul 2026 13:35:09 -0400 Subject: [PATCH] fix(macos-container): launch gateway as a module, not /app/gateway_init.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macOS infra container's init script still spawned the supervisor as `python3 /app/gateway_init.py`. 5ad3449 moved bot_bottle from flat files under /app into a pip-installed package, so that file no longer exists: the supervisor never started, mitmdump never generated its CA, and the launch failed downstream with a misleading "gateway CA not available" error pointing at TLS rather than at the supervisor. This is the same defect 127ba49 fixed for the firecracker backend. It survived on macOS because CI has no Apple Container runner — the KVM runner added in c193b04 covers firecracker, and ubuntu-latest covers docker, but nothing exercises macos_container. test_macos_infra asserted the substring "gateway_init.py", which the broken path satisfied; it now asserts the module form, matching the assertion 127ba49 already made in test_firecracker_infra_vm. Verified end to end on the macos-container backend: image builds, CA is generated, agent registers, and a headless bottle runs a prompt. Co-Authored-By: Claude Opus 4.8 --- bot_bottle/backend/macos_container/infra.py | 2 +- tests/unit/test_macos_infra.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bot_bottle/backend/macos_container/infra.py b/bot_bottle/backend/macos_container/infra.py index c0eea45..6bca5c9 100644 --- a/bot_bottle/backend/macos_container/infra.py +++ b/bot_bottle/backend/macos_container/infra.py @@ -101,7 +101,7 @@ def _init_script(port: int) -> str: # Gateway data plane, multi-tenant against the local control plane. f"( cd /app && BOT_BOTTLE_GATEWAY_DAEMONS={_GATEWAY_DAEMONS} " f"BOT_BOTTLE_ORCHESTRATOR_URL=http://127.0.0.1:{port} " - f"SUPERVISE_DB_PATH={_DB_PATH_IN_CONTAINER} python3 /app/gateway_init.py ) &\n" + f"SUPERVISE_DB_PATH={_DB_PATH_IN_CONTAINER} python3 -m bot_bottle.gateway_init ) &\n" "while : ; do wait ; done\n" ) diff --git a/tests/unit/test_macos_infra.py b/tests/unit/test_macos_infra.py index 0971131..012f531 100644 --- a/tests/unit/test_macos_infra.py +++ b/tests/unit/test_macos_infra.py @@ -46,7 +46,9 @@ class TestInfraRun(unittest.TestCase): argv = self._run_container(MacosInfraService(repo_root=Path("/r"))) script = argv[-1] self.assertIn("bot_bottle.orchestrator", script) - self.assertIn("gateway_init.py", script) + # Gateway launches via the installed package (there is no + # /app/gateway_init.py file since the daemons moved into bot_bottle). + self.assertIn("bot_bottle.gateway_init", script) self.assertIn("127.0.0.1", script) # they reach each other on loopback def test_db_is_a_container_only_volume(self) -> None: