story-kit: create 97_bug_agent_pool_allows_multiple_instances_of_the_same_agent_to_run_concurrently

This commit is contained in:
Dave
2026-02-23 20:38:16 +00:00
parent dc1e441a86
commit 39dbace8bf

View File

@@ -0,0 +1,28 @@
---
name: "Agent pool allows multiple instances of the same agent to run concurrently"
---
# Bug 97: Agent pool allows multiple instances of the same agent to run concurrently
## Description
The agent pool does not enforce single-instance concurrency per agent name. When the pipeline auto-advances (e.g. coder finishes and QA starts automatically), it spawns a new agent instance even if that agent is already running on another story. With only one QA agent defined in project.toml, two QA processes were observed running simultaneously on different stories, driving load average past 33 on an M1 Mac. Each QA run spawns cargo clippy, cargo test, and vitest — two concurrent runs is brutal on resources.
## How to Reproduce
1. Have one QA agent defined in project.toml\n2. Start a coder on story A — when it completes, pipeline auto-starts QA on story A\n3. While QA is running on story A, start a coder on story B — when it completes, pipeline auto-starts QA on story B\n4. Observe two QA agents running simultaneously despite only one being defined
## Actual Result
Two QA agent processes run concurrently, competing for CPU and causing extreme load.
## Expected Result
The agent pool should enforce single-instance concurrency per agent name. If QA is already running, the next QA job should queue until the current one finishes.
## Acceptance Criteria
- [ ] Agent pool checks if an agent name is already running before spawning a new instance
- [ ] If the agent is busy, the new job is queued and starts when the agent becomes available
- [ ] Pipeline auto-advancement respects the concurrency limit
- [ ] cargo clippy and cargo test pass