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
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

1 participant