merge_bottles_runtime KeyErrors on a repo declared only by a later bottle #457
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
merge_bottles_runtimeraisesKeyErrorwhenever a bottle composed later declares agit-gate.reposentry that an earlier bottle does not.Repro
In practice this is
./cli.py start <agent> --bottle claude-dev --bottle bot-bottle-dev, where only the second bottle carries repos:Cause
_merge_two_bottles_runtimebuilds the union of repo names, then resolves each one withPython evaluates a
.get()default eagerly, sobase_repos_by_name[n]is indexed for every name — including names that exist only in the override. The union logic directly above is correct; only the lookup is wrong.Impact
Bottle order becomes load-bearing for no stated reason: reversing the two
--bottleflags works around it. The merge-order rules documented onmerge_bottles_runtimesay nothing about repos having to appear in the first bottle.Fix
Pick from the override first and fall back lazily, e.g.
plus a regression test in
tests/unit/test_manifest_bottle_merge.pycovering an override-only repo (the existing coverage only exercises names present in the base).Found while composing bottles for the #392 nested-containers verification; unrelated to that change and present on
main.