agentsmesh merge
Resolve .agentsmesh/.lock merge conflicts after a git merge. Rebuilds the lock file from the current canonical state.
Usage
agentsmesh mergeagentsmesh merge --globalFlags
| Flag | Description |
|---|---|
--global | Resolve conflicts in ~/.agentsmesh/.lock. |
When to use
Run agentsmesh merge after a git merge (or git rebase) that produces conflicts in .agentsmesh/.lock. Use agentsmesh merge --global for conflicts in ~/.agentsmesh/.lock.
The lock file is a YAML file containing checksums of the canonical .agentsmesh/ sources plus an outputs map of generated-file checksums. When two branches both modify canonical files and both regenerate, the lock files will conflict. Git cannot automatically resolve this.
Workflow
# 1. Pull and merge (lock file has conflicts)git pull origin main# CONFLICT (.agentsmesh/.lock): Merge conflict in .agentsmesh/.lock
# 2. Resolve canonical source conflicts first (if any)# git status will show conflicting .agentsmesh/ files# Resolve them manually, then stage
# 3. Rebuild the lock from current canonical stateagentsmesh merge
# 4. Regenerate to apply merged canonical sourcesagentsmesh generate
# 5. Commit the resolved stategit add .agentsmesh/.lock .claude/ .cursor/git commit -m "merge: resolve agentsmesh config conflicts"What merge does
agentsmesh merge reads the current canonical files in .agentsmesh/ (or ~/.agentsmesh/ with --global) and rewrites the matching lock file with fresh canonical-source checksums computed from the current state.
It does not modify any canonical or generated files — it only fixes the lock file. It keeps the outputs map of generated-file checksums: the entries of both branches are combined, and where both branches recorded the same file, your branch’s checksum is kept. That checksum can be out of date for a file the other branch changed, so agentsmesh check may report that file as modified until you run agentsmesh generate, which records the real checksums. The workflow above already does this. Only when neither branch’s lock had an outputs map does the rebuilt lock have none, and then check skips output verification until you generate.
Collaboration strategies
The merge behavior can be configured in agentsmesh.yaml:
collaboration: strategy: merge # merge | lock | last-wins| Strategy | Behavior |
|---|---|
merge | Standard 3-way merge. Use agentsmesh merge to resolve lock conflicts. |
lock | Locked features cannot be regenerated without --force. |
last-wins | Always overwrite the lock with the latest state. No conflicts, but less safe. |