fix(manifest): OR nested_containers across composed bottles
tracker-policy-pr / check-pr (pull_request) Successful in 13s
test / integration-docker (pull_request) Successful in 38s
test / unit (pull_request) Successful in 40s
lint / lint (push) Successful in 50s
test / integration-firecracker (pull_request) Successful in 3m22s
test / coverage (pull_request) Successful in 19s
test / publish-infra (pull_request) Has been skipped

merge_bottles_runtime sees resolved bottles, where a bottle that never
mentioned the key is indistinguishable from one that set it false. With
"later replaces" semantics, `--bottle with-containers --bottle claude-dev`
silently dropped the capability — the second bottle's default clobbered
it. OR instead: composing bottles adds capabilities, it does not remove
them. The file-based extends path still sees raw keys, so an explicit
`nested_containers: false` in a child continues to turn it back off.

Also surface the flag in the launch summary, where its absence was the
only reason the clobber went unnoticed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 15:43:31 -04:00
parent ba25845886
commit 9e9b418a92
4 changed files with 24 additions and 9 deletions
+9 -5
View File
@@ -56,11 +56,15 @@ class TestMergeBottlesRuntime(unittest.TestCase):
result = merge_bottles_runtime([base, override])
self.assertFalse(result.supervise)
def test_nested_containers_later_wins(self):
base = _bottle(nested_containers=True)
override = _bottle(nested_containers=False)
self.assertFalse(merge_bottles_runtime([base, override]).nested_containers)
self.assertTrue(merge_bottles_runtime([override, base]).nested_containers)
def test_nested_containers_survives_a_later_bottle(self):
"""OR, not replace: a resolved bottle that never mentioned the key is
indistinguishable from one that set it false, so `--bottle with-docker
--bottle claude-dev` must not silently drop the capability."""
enabled = _bottle(nested_containers=True)
quiet = _bottle(env={"X": "1"})
self.assertTrue(merge_bottles_runtime([enabled, quiet]).nested_containers)
self.assertTrue(merge_bottles_runtime([quiet, enabled]).nested_containers)
self.assertFalse(merge_bottles_runtime([quiet, quiet]).nested_containers)
def test_three_bottles_merged_left_to_right(self):
b1 = _bottle(env={"A": "1", "B": "1", "C": "1"})