Skip to content

Add parallel agent session support with git worktrees#49

Open
jeffzeng-aws wants to merge 1 commit intoanthropics:mainfrom
jeffzeng-aws:feature/parallel-agent-sessions
Open

Add parallel agent session support with git worktrees#49
jeffzeng-aws wants to merge 1 commit intoanthropics:mainfrom
jeffzeng-aws:feature/parallel-agent-sessions

Conversation

@jeffzeng-aws
Copy link

Summary

  • WorktreeManager: Creates isolated git worktrees per issue, allowing multiple agents to work simultaneously without file conflicts
  • MergeManager: Sequential merge queue that processes completed branches in order, with automatic conflict detection and queue pausing
  • Session isolation: Each session gets unique token files, commit queues, and port allocations (slots 0-3 with 10 ports each)
  • GitHub Actions updates: issue-poller supports triggering multiple builds, agent-builder accepts parallel mode parameters
  • Documentation: Comprehensive docs covering architecture, components, conflict handling, and testing

Test plan

  • Tested worktree creation/cleanup for multiple issues locally
  • Tested successful sequential merges of non-conflicting branches
  • Tested conflict detection when two branches modify the same file
  • Tested full parallel flow with 3 concurrent simulated agents
  • Deploy to staging environment and test with real AgentCore sessions
  • Verify GitHub Actions workflows trigger correctly in parallel mode

🤖 Generated with Claude Code

This change enables multiple coding agents to run simultaneously on
different GitHub issues. Key features:

- WorktreeManager: Creates isolated git worktrees per issue, allowing
  agents to work without file conflicts during development
- MergeManager: Sequential merge queue that processes completed branches
  in order, with automatic conflict detection and queue pausing
- Session isolation: Each session gets unique token files, commit queues,
  and port allocations to prevent resource conflicts
- GitHub Actions updates: issue-poller now supports triggering multiple
  builds, agent-builder accepts parallel mode parameters

Tested locally with:
- Worktree creation/cleanup for multiple issues
- Successful sequential merges of non-conflicting branches
- Conflict detection when two branches modify the same file
- Full parallel flow with 3 concurrent agents

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant