Added simple 3 way merge for unknown files instead of override.#798
Open
JEdward7777 wants to merge 1 commit intogenesis-ai-dev:mainfrom
Open
Added simple 3 way merge for unknown files instead of override.#798JEdward7777 wants to merge 1 commit intogenesis-ai-dev:mainfrom
JEdward7777 wants to merge 1 commit intogenesis-ai-dev:mainfrom
Conversation
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.
Fix: Remote-only changes to unrecognized file types silently discarded during sync
The Problem
When syncing, if the local user has any modified file (e.g.,
metadata.json), the branches diverge and Frontier reports all differing files as conflicts — including files that only changed on the remote side. TheOVERRIDEstrategy, which was the default for all unrecognized file types (.yaml,.py,.txt, etc.), unconditionally kept the local version, silently discarding the remote changes.The behavior was inconsistent and confusing:
Whether remote changes survived depended entirely on whether you happened to have an unsaved edit somewhere — a race condition that's hard to debug.
The Fix
Introduces a new
SIMPLE_3WAYmerge strategy that becomes the default fallback for unrecognized file types. It compares both sides against the common ancestor (base) to determine which side actually changed:OVERRIDE)SIMPLE_3WAY)Why This Is Safe
No change to existing explicit strategies — Files mapped to
OVERRIDE(chat-threads.json,dictionary.sqlite, etc.),CODEX_CUSTOM_MERGE,SPECIAL,ARRAY,JSONL,JSON_MERGE_3WAY, andIGNOREare completely unaffected.Makes behavior consistent, not new — Remote changes to unrecognized files were already being accepted when no local changes existed (fast-forward path). This PR simply makes the diverged-merge path behave the same way. If accepting remote changes was safe in the fast-forward case, it's equally safe in the diverged case when the local copy hasn't changed.
Local always wins on true conflicts — When both sides modify the same file, local still wins. The only change is that we stop overwriting remote changes when the local file is identical to the base.
Files Changed
src/projectManager/utils/merge/types.ts— AddedSIMPLE_3WAYenum valuesrc/projectManager/utils/merge/strategies.ts— Added pattern list, changed default fallbacksrc/projectManager/utils/merge/resolvers.ts— AddedSIMPLE_3WAYcase handlersrc/test/suite/mergeStrategies.test.ts— Updated test expectationdocs/merge-strategy.md— Documented the new strategyNote
Medium Risk
Changes the default conflict resolution for previously unrecognized file types, which can alter which side’s content is kept during sync/merge and could surface new merge outcomes for users’ projects.
Overview
Updates merge conflict handling so previously unrecognized file types default to a new
SIMPLE_3WAYstrategy rather thanOVERRIDE, preventing remote-only changes from being silently discarded during diverged merges.Implements
SIMPLE_3WAYinresolvers.ts(base/ours/theirs comparison with local wins on true conflicts), wires it intotypes.tsandstrategies.tsas the fallback strategy, updates the merge-strategy docs, and adjusts themergeStrategiestest to expect the new default.Written by Cursor Bugbot for commit f0b74f9. This will update automatically on new commits. Configure here.