feat(gptodo): add concurrency limit for spawn command#301
Conversation
Adds --max-concurrent option (default 4) to prevent overwhelming the system with unlimited background agents. Before spawning, reconciles session state with actual tmux sessions to get accurate running count. Also adds test_subagent.py with tests for session save/load/list.
|
@greptileai review |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 5d32970 in 17 seconds. Click for details.
- Reviewed
155lines of code in2files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_l67rZJaQ2HTe17x3
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Greptile SummaryThis PR adds a concurrency limit for the Key Changes:
Test Coverage: Confidence Score: 4/5
Important Files Changed
Flowchartflowchart TD
A[User calls: gptodo spawn task-id] --> B{Check if background mode?}
B -->|Yes| C{max_concurrent > 0?}
B -->|No| H[Execute task agent]
C -->|Yes| D[List sessions with status=running]
C -->|No| H
D --> E[Reconcile with tmux state]
E --> F[Loop through running sessions]
F --> G{check_session still running?}
G -->|Yes| I[Add to actually_running list]
G -->|No| F
I --> J{len >= max_concurrent?}
J -->|Yes| K[Display warning message]
K --> L[List running sessions]
L --> M[Show kill command hint]
M --> N[Return early]
J -->|No| H
H --> O[Find task]
O --> P[Build prompt]
P --> Q[Spawn agent]
Last reviewed commit: 5d32970 |
Summary
--max-concurrentoption togptodo spawn(default 4) to prevent overwhelming the system with unlimited background agentstest_subagent.pywith tests for session save/load/list operationsTest plan
Important
Adds concurrency limit to
gptodo spawncommand and tests for session management.--max-concurrentoption togptodo spawncommand incli.py, defaulting to 4, to limit concurrent background agents.test_subagent.pywith tests for session save/load and list operations, including edge cases like nonexistent and corrupted sessions.This description was created by
for 5d32970. You can customize this summary. It will automatically update as commits are pushed.