Skip to content

Parallel Execution

Speed up development with concurrent agent execution.

Time: 5 minutes


What You'll Learn

  • When parallel execution is safe
  • How to trigger parallel mode
  • Understanding execution strategies
  • Monitoring parallel tasks

Automatic Detection

Nova AI automatically detects parallelizable tasks:

/novaai fix test_auth.py and test_user.py and test_payment.py

Output:

📊 Execution Strategy: simple_parallel
   Reason: 3 independent tasks - safe for parallel execution
   Safety Level: ✅ SAFE
   Estimated Speedup: 2.4x

Tasks (3):
   1. fix test_auth.py (debugger)
   2. fix test_user.py (debugger)
   3. fix test_payment.py (debugger)

Proceeding with execution...

Execution Strategies

Sequential (Default)

Single task or dependent operations.

/novaai commit changes and push to GitHub
📊 Execution Strategy: sequential
   Reason: git operations must be sequential

Simple Parallel

Multiple independent tasks.

/novaai fix all 5 failing tests
📊 Execution Strategy: simple_parallel
   Reason: 5 independent tasks
   Estimated Speedup: 3.2x

DAG (Dependency-Aware)

Tasks with dependencies.

/novaai implement feature, then add tests, then update docs
📊 Execution Strategy: dag
   Reason: Tasks have dependencies

   Layer 1: implement feature
   Layer 2: add tests (depends on layer 1)
   Layer 3: update docs (depends on layer 2)

Safety Checks

Nova AI prevents unsafe parallelization:

File Conflicts

/novaai update auth.py for security and add feature to auth.py
⚠️  Execution Strategy: sequential
    Reason: Both tasks modify auth.py
    Safety Level: SAFE (forced sequential)

Git Operations

/novaai fix tests and commit changes
⚠️  Execution Strategy: sequential
    Reason: Contains git operations

Database Operations

/novaai run migrations and update schema
⚠️  Execution Strategy: sequential
    Reason: Database operations detected

Monitoring Progress

Parallel tasks show real-time progress:

⏳ [1/3] fix test_auth.py
   └─ debugger analyzing...

✅ [2/3] fix test_user.py
   └─ Completed in 12s

⏳ [3/3] fix test_payment.py
   └─ debugger applying fix...

Background Execution

Run tasks in background for long operations:

/novaai implement feature X
> Run in background? [y/N]

Select "Run in Background" from the plan approval.

Monitor with:

/background list
ID       Status    Task                    Duration
─────────────────────────────────────────────────────
abc123   running   implement feature X     2m 34s
def456   done      fix auth tests          5m 12s

Worktree Isolation

Parallel tasks use git worktrees for isolation:

/tmp/nova-worktrees/
├── abc123-task1/    # Isolated copy for task 1
├── abc123-task2/    # Isolated copy for task 2
└── abc123-task3/    # Isolated copy for task 3

Benefits: - No file conflicts - Independent git state - Safe rollback


Performance Gains

Scenario Sequential Parallel Speedup
3 test fixes 3 min 1 min 3x
5 lint fixes 5 min 1.5 min 3.3x
Multi-file refactor 10 min 3 min 3.3x

When NOT to Parallelize

Some tasks should stay sequential:

Task Type Reason
Git commits Race conditions
Database migrations Order matters
File overwrites Data loss risk
Deployment Sequence critical

Configuration

Adjust parallel settings:

# Max concurrent agents
export NOVA_MAX_PARALLEL=4

# Worktree location
export NOVA_WORKTREE_DIR="/tmp/nova-worktrees"

What's Next?