The semantic merge conflict: tracking exported-symbol diffs to catch what git misses with parallel coding agents

Avinash2k5 · reddit · 2026-11-24

A deep dive into the failure mode of running parallel coding agents on isolated worktrees: semantic merge conflicts. Git only detects line-level collisions, so when Agent A changes a payload schema in a shared package while Agent B writes a consumer against the old shape, both branches merge cleanly and pass local builds — then integration fails on staging minutes later.

Root cause: isolation hides contract drift. Humans surface shared-interface changes via Slack and PR review; agents have no peripheral vision and treat their branch HEAD as ground truth.

Workarounds that fail at scale: full monorepo CI per commit burns runner budget and slows the loop; relying on PR review dumps cross-branch symbol mapping back on developers.

What works: track exported symbol diffs across active worktree branches — generate a manifest of exported functions/types/schemas from the base branch, diff it against each agent branch at commit time, and check whether other active branches import the touched symbols. On a shape change, flag the contract collision immediately and trigger automated rebase + typecheck on dependent branches while the agent is still running.

Original post →

More from coding & agent

coding & agent channel →