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:25:26 +00:00
parent 0b36bec142
commit 83a4b1243d
10 changed files with 389 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
agents,duration,success,failed,timeout,avg_response,stddev,min_response,max_response,peak_cpu,avg_cpu,peak_mem_mb,avg_mem_mb,peak_mem_pct,avg_mem_pct,peak_procs,baseline_mem,mem_per_agent,cost_score
1,1.02,0,1,0,0.01,0.00,0.01,0.01,0.0,0.0,2460.7,2459.8,0.0,0.0,0,2458.8,1.9,0.00
2,1.02,0,2,0,0.00,0.00,0.00,0.00,0.0,0.0,2464.2,2463.7,0.0,0.0,0,2463.2,0.5,0.00
3,1.02,0,3,0,0.01,0.00,0.01,0.01,0.0,0.0,2444.0,2443.8,0.0,0.0,0,2443.7,0.1,0.00
1 agents duration success failed timeout avg_response stddev min_response max_response peak_cpu avg_cpu peak_mem_mb avg_mem_mb peak_mem_pct avg_mem_pct peak_procs baseline_mem mem_per_agent cost_score
2 1 1.02 0 1 0 0.01 0.00 0.01 0.01 0.0 0.0 2460.7 2459.8 0.0 0.0 0 2458.8 1.9 0.00
3 2 1.02 0 2 0 0.00 0.00 0.00 0.00 0.0 0.0 2464.2 2463.7 0.0 0.0 0 2463.2 0.5 0.00
4 3 1.02 0 3 0 0.01 0.00 0.01 0.01 0.0 0.0 2444.0 2443.8 0.0 0.0 0 2443.7 0.1 0.00