fix(#338): Add max concurrent agents limit

- Add MAX_CONCURRENT_AGENTS configuration (default: 20)
- Check current agent count before spawning
- Reject spawn requests with 429 Too Many Requests when limit reached
- Add comprehensive tests for limit enforcement

Refs #338
This commit is contained in:
Jason Woltje
2026-02-05 18:30:42 -06:00
parent ce7fb27c46
commit 3b80e9c396
4 changed files with 211 additions and 2 deletions

View File

@@ -37,4 +37,7 @@ export const orchestratorConfig = registerAs("orchestrator", () => ({
yolo: {
enabled: process.env.YOLO_MODE === "true",
},
spawner: {
maxConcurrentAgents: parseInt(process.env.MAX_CONCURRENT_AGENTS ?? "20", 10),
},
}));