Skip to content

feat(agents): add max_agents_per_repo to allow multiple agents per repo#44

Open
PieterPel wants to merge 1 commit into
untra:mainfrom
PieterPel:feat/multiple-agents-per-repo
Open

feat(agents): add max_agents_per_repo to allow multiple agents per repo#44
PieterPel wants to merge 1 commit into
untra:mainfrom
PieterPel:feat/multiple-agents-per-repo

Conversation

@PieterPel
Copy link
Copy Markdown

Closes #43

Summary

  • Adds agents.max_agents_per_repo config field (default: 1, fully backward-compatible)
  • Adds State::project_agent_count() to count running agents per project
  • Refactors is_project_busy() to delegate to project_agent_count()
  • Updates try_launch and auto_launch to enforce the configurable limit
  • Improves status message to show N/MAX agents active per repo

Why

When git.use_worktrees = true, each ticket gets an isolated worktree so there's no conflict between concurrent agents on the same repo. The previous hard boolean is_project_busy() made the 1-per-repo limit impossible to lift even when worktrees made it safe to do so.

Usage

[agents]
max_parallel = 5
max_agents_per_repo = 3  # new — default is 1 (no behaviour change)

Test plan

  • cargo check passes
  • New unit tests for project_agent_count, max_agents_per_repo default, and is_project_busy consistency
  • Existing tests unchanged

Adds `agents.max_agents_per_repo` (default: 1, backward-compatible) so
operators using git worktrees can run multiple agents on the same repo
concurrently without hitting the hardcoded single-agent-per-project block.

- Add `max_agents_per_repo: usize` to `AgentsConfig` (serde default = 1)
- Add `State::project_agent_count()` to count running agents per project
- Refactor `is_project_busy()` to delegate to `project_agent_count()`
- Update `try_launch` and `auto_launch` to check count against config limit
- Add tests for count behaviour, default value, and busy-state consistency
@untra
Copy link
Copy Markdown
Owner

untra commented May 17, 2026

👋 heya, thank for the contribution . I might include this in the next release, but with some adjustments.

I don't have the infrastructure to take community contributions in this project just yet, but I would like to help you out with your operator use-case . I'm trying to unify a number of different tools to define auditable AI workflows and standardizing governance controls for AI doing kanban shaped work. If this is something I can help you with, please reach out to me! email, X, linkedin DM happy to chat privately.

projects = "."
state = ".tickets/operator"
worktrees = "/Users/samuelvolin/.operator/worktrees"
worktrees = "/Users/samuelviolin/.operator/worktrees"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎻

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.

feat(agents): add max_agents_per_repo config to allow multiple agents per repo

2 participants