Multi-Agent Coordination
When multiple agents work on the same codebase, Loom provides coordination features to prevent conflicts.Overview
Multi-agent coordination prevents:- File conflicts: Two agents modifying the same file simultaneously
- Resource contention: Multiple agents claiming the same task
- Merge conflicts: Overlapping changes that are hard to reconcile
How It Works
File Locking
When an agent claims a task, it can declare which files it intends to modify:- Expire after a configurable timeout (default: 1 hour)
- Are automatically released when the task completes
- Prevent other agents from claiming conflicting work
Lock Expiration
Locks have a timeout to prevent deadlocks if an agent crashes:Conflict Detection
Loom can detect potential conflicts between agents:Commands
View Locks
Detect Conflicts
Claim with Files
Configuration
Enable coordination inloom.yaml:
Workflow
Single Agent
For single-agent workflows, coordination is still useful for:- Tracking which files are being modified
- Preventing accidental concurrent modifications
- Understanding task scope
Multiple Agents
For multi-agent workflows:- Agent A claims a task with file declarations
- Agent B checks for conflicts before claiming
- Both agents work in parallel on non-overlapping files
- Locks are released as tasks complete
Best Practices
1. Declare All Files
When claiming, declare all files you might modify:2. Check Before Claiming
Always check for conflicts:3. Release Unused Locks
If you claimed files you don’t need, release them:4. Use Appropriate Timeouts
Set lock timeout based on task complexity:5. Monitor Locks
Regularly check active locks:Conflict Resolution
When conflicts are detected:- Communicate: Coordinate with the other agent’s owner
- Prioritize: Let the higher-priority task proceed
- Split: Divide work to avoid file overlap
- Sequence: Complete one task before starting the conflicting one