fix: deduplicate reconsolidation candidates with same name across images#2063
Merged
mattgodbolt merged 2 commits intomainfrom Apr 11, 2026
Merged
fix: deduplicate reconsolidation candidates with same name across images#2063mattgodbolt merged 2 commits intomainfrom
mattgodbolt merged 2 commits intomainfrom
Conversation
… images ## Problem CEFS consolidation failed again (2026-04-11, run #24277747674) with: ValueError: Duplicate subdir name 'compilers_swift_post-6-2_6.2.4' in consolidation group: 'compilers/swift/post-6-2 6.2.4' (from_reconsolidation=True) conflicts with 'compilers/swift/post-6-2 6.2.4' The previous fix (#2059) only filtered out reconsolidation candidates whose name appeared as a fresh item. But this collision involved TWO reconsolidation candidates — the same installable appearing in two different old consolidated images (likely due to multiple consolidation passes over time). ## Fix After filtering fresh-vs-recon collisions, also deduplicate within the reconsolidation candidates themselves. When the same installable name appears in multiple old consolidated images, only the first occurrence is kept. The detection layer in consolidation.py (ValueError on duplicate subdir names) correctly caught and reported the issue; this PR fixes the prevention layer. ## Test New test `test_prepare_consolidation_items_rejects_duplicate_recon_names` reproduces the exact production scenario: two reconsolidation candidates from different consolidated images both with name 'compilers/swift/post-6-2 6.2.4'. 🤖 Generated by LLM (Claude, via OpenClaw)
…ates When the same installable appears in multiple old consolidated images, sort by squashfs mtime (newest first) before deduplicating, so we retain the candidate from the most recently created consolidated image rather than arbitrarily the first one encountered. This ensures that if content somehow diverged between reconsolidations (e.g. reinstall between consolidation passes), we pick the most up-to-date. 🤖 Generated by LLM (Claude, via OpenClaw)
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CEFS consolidation failed on 2026-04-11 (run #24277747674):
The previous fix (#2059) only handled fresh-item vs reconsolidation-item collisions. This collision involved two reconsolidation candidates — the same installable appearing in two different old consolidated images (likely from multiple consolidation passes accumulating the same item in multiple images).
Neither item was in the fresh items list, so the fresh-vs-recon filter didn't trigger. Both ended up in the same group and produced the same sanitized subdir name.
Fix
After filtering fresh-vs-recon collisions, deduplicate within the reconsolidation candidates themselves. When the same installable name appears in multiple old consolidated images, keep only the first occurrence.
The detection layer in (ValueError on duplicate subdir names) correctly caught and reported the issue; this PR fixes the prevention layer.
Test
New test
test_prepare_consolidation_items_rejects_duplicate_recon_namesreproduces the exact production scenario: two recon candidates from different consolidated images with the same installable name.(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)