
Andrew Hanna

Andrew Hanna

TL;DR: A merge conflict is two competing changes to the same part of a file that version control cannot reconcile on its own. In Salesforce, most of them are not real: they are XML ordering noise that a metadata-aware merge should settle without asking anyone. The interesting question is what happens on the conflicts that survive that filter, and that is the first place in a release pipeline where AI genuinely earns its keep.
Two structural reasons, neither of which is anybody's fault.
First, the files are enormous. A Profile describes permissions across the whole org, so two developers touching two unrelated objects can produce adjacent edits in one file. Profiles, permission sets, page layouts, Lightning pages and custom labels are the usual suspects.
Second, element ordering inside those files is not stable. Retrieve the same Profile twice and the list entries can come back in a different sequence. Git sees reordered lines and calls it a change, even when the permissions are byte-for-byte equivalent in meaning. That is how a team ends up spending a Thursday afternoon resolving a conflict that does not exist.
This distinction is the whole article, so it is worth stating plainly.
Treating these as one problem is why conflict tooling gets a bad name. They need different machinery.
A metadata-aware merge parses the XML into elements with stable keys and merges element by element instead of line by line. The open-source Salesforce git merge driver is a good public reference for the approach: it identifies unique keys inside metadata elements, merges individual entries rather than whole arrays, handles deterministic reordering for genuinely ordered types such as picklist value sets and record type assignments, and only falls back to a raw conflict when it does not recognise a key. Commercial tools do the same thing; Gearset, for example, describes a metadata-aware semantic merge algorithm for exactly this reason.
This is not AI and should not be. It is parsing, and parsing should be deterministic, fast and boring. Done properly it removes the large majority of Salesforce conflicts before a human ever sees them.
What it cannot do is decide. When both branches set the same key to different values, a correct deterministic merger refuses, and it is right to refuse.
Right there, on the refusal. Conflict resolution is an unusually good first job for AI in delivery, for four reasons.
Compare that with asking a model to write Apex, where the input is unbounded, the context is ambiguous and verification is the expensive part. Conflict resolution is the opposite shape, which is why it is the sensible place to start.
Yes, and quickly. Salesforce's own DevOps Center now ships merge conflict resolution through MCP tools, using large language models to analyse conflicts, explain them in natural language and suggest solutions from inside an IDE. When the platform vendor puts LLM conflict analysis in the box, the argument about whether this belongs in a pipeline is over.
Serpent has approached it from the same direction. It is the
only native MCP server in Salesforce DevOps, with
resolve_metadata_conflict alongside plan_deploy,
create_pull_request and trigger_pipeline, so the same
resolution can be driven from Claude, Cursor, Windsurf or Agentforce with preflight
checks and mandatory human approval. AI code review runs on every plan, including the
free tier, because the review and the conflict are the same conversation about the
same change.
Should AI auto-merge Salesforce conflicts without review?
No. Propose and explain, then require a human approval, particularly on Profiles and permission sets where a bad merge changes access for every assigned user.
Does semantic merging make AI unnecessary?
The opposite. It removes the false conflicts, so the ones left are exactly the judgement calls where extra context helps.
Why are Profiles the worst offenders?
They are single enormous files covering the whole org, so unrelated work lands in adjacent lines, and their list ordering is not guaranteed to be stable between retrievals.
What context does an AI resolver need to be useful?
The three-way diff, the linked ticket, the commit messages and the state of the target org. Without those it is guessing more confidently than a human would.
How do we know a resolution was correct?
Validate the merged result against the target org before the merge lands, and keep an audit record of what was proposed and who approved it.
Commitment free!