Add concurrent agent limiting to kugetsu CLI

- Add MAX_CONCURRENT_AGENTS (default: 3) to limit concurrent agents
- Implement acquire_agent_slot() and release_agent_slot() with flock
- Wrap cmd_start, cmd_continue, and cmd_delegate with slot management
- cmd_delegate holds slot until background task completes (fire-and-forget + blocking)
- Add basic concurrency tests to test suite
This commit is contained in:
shokollm
2026-03-31 07:26:00 +00:00
parent dfc87e3da3
commit 3c15d8df1d
12 changed files with 652 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
# Parallel Capacity Test Report
**Generated:** 2026-03-31 04:07:51
## Summary
| Agents | Duration | Success | Failed | Timeout | Avg Response | Peak Mem (MB) | Mem/Agent | Cost Score |
|--------|----------|---------|--------|---------|--------------|---------------|-----------|------------|
| 1 | 1.0s | 0 | 1 | 0 | 0.0s | 2461MB | 1.9MB | 0.00 |
| 2 | 1.0s | 0 | 2 | 0 | 0.0s | 2464MB | 0.5MB | 0.00 |
| 3 | 1.0s | 0 | 3 | 0 | 0.0s | 2444MB | 0.1MB | 0.00 |
## Cost Analysis
| Metric | Value |
|--------|-------|
| Baseline Memory | 2458.8 MB |
| Avg Memory per Agent | 0.8 MB |
| Memory Limit | 1024 MB |
| Estimated Max Capacity | 1241 agents |
## Key Findings
## Recommendations
2. **Monitor closely:** 5+ agents
3. **Implement circuit breaker** when failure rate exceeds threshold