Entity-level merge for multi-agent parallel edits

Resolved 💬 2 comments Opened Mar 5, 2026 by rs545837 Closed Mar 5, 2026

Problem

When multiple Codex agents work in parallel on the same repo, they frequently touch the same files. Git's line-based merge creates false conflicts when two agents add different functions to the same file, even though the changes are completely independent.

This wastes tokens (agents retry or attempt to resolve non-conflicts), wastes time (human has to step in), and limits how much parallelism you can actually get out of multi-agent setups.

From a recent HN discussion, a user running 10+ agents simultaneously said:

"I'm running agents doing merges right now... If you can avoid that more often it will definitely save both time and money."

The fix

weave is an entity-level merge driver for Git. Instead of diffing lines, it parses code with tree-sitter into entities (functions, classes, methods), matches them by name and structural hash, and merges per-entity.

  • Agent A adds getUsers() to service.ts, Agent B adds deleteUser() to the same file → clean merge (different entities)
  • Agent A modifies processPayment(), Agent B also modifies processPayment()real conflict (same entity, different changes)

Benchmark: 31/31 clean vs git's 15/31 on real-world scenarios. 14 languages supported (TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, Ruby, C#, PHP, Swift, Fortran + config formats).

Why this matters for Codex specifically

Codex already has multi-agent orchestration (agents.max_threads, the TUI overhaul in #12047). The more agents you run in parallel, the more likely they touch the same file. Entity-level merge directly increases the ceiling on useful parallelism.

It's a Git merge driver, so the simplest integration is zero-code: users run weave setup in their repo and it works on the next merge. But a deeper integration could use sem-core (the entity extraction library underneath) to do entity-aware task decomposition: "Agent A owns functions X, Y, Z in this file. Agent B owns functions P, Q, R." Conflicts become structurally impossible.

Prior art / validation

  • Elijah Newren (author of Git's merge-ort) and Taylor Blau (Git team) reviewed weave positively
  • GitButler team is evaluating integration (they can't use Mergiraf due to GPL, weave is MIT/Apache-2.0)
  • Discussion thread with GitButler
  • Currently on Homebrew: brew install ataraxy-labs/tap/weave

Happy to discuss further or help with a prototype integration.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗