Skip to content

Fix: Prevent duplicate worktree path crash#553

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/repoprompt-54-worktree-path-crash
Open

Fix: Prevent duplicate worktree path crash#553
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/repoprompt-54-worktree-path-crash

Conversation

@sentry

@sentry sentry Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This PR addresses REPOPROMPT-54 by preventing a fatal crash when GitService.makeWorktreeDescriptors encounters duplicate standardized worktree paths.

Previously, Dictionary(uniqueKeysWithValues:) was used to construct layoutsByPath. This initializer traps with a fatal error if multiple entries resolve to the same key (standardized file path), which can occur in certain git/codex worktree configurations.

The fix replaces Dictionary(uniqueKeysWithValues:) with Dictionary(_:uniquingKeysWith: { first, _ in first }). This change ensures that if duplicate standardized paths are encountered, the first value is retained, and the application continues to function without crashing. This turns a crash into a deterministic deduplication, as identified in the root cause analysis.

Fixes REPOPROMPT-54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants