feat(runtime): cap spawned child agents - #911
Conversation
Greptile SummaryAdds a configurable scan-wide child-agent spawn cap.
Confidence Score: 3/5The child-agent cap needs atomic capacity enforcement before this PR is safe to merge because concurrent spawn requests can exceed the configured limit. The implementation checks graph size separately from coordinator-locked registration, allowing multiple asynchronous agents to approve requests against the same available slot. Files Needing Attention: strix/core/execution.py Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
strix/core/execution.py:240-242
**Non-atomic child capacity check**
When two agents request children near the configured limit, both calls can count the graph before either awaited registration records its child, causing the scan to spawn more child agents than `STRIX_MAX_CHILD_AGENTS` permits.
Reviews (1): Last reviewed commit: "feat(runtime): cap spawned child agents" | Re-trigger Greptile |
|
Fixed Greptile's concurrency finding in What changed:
Validation:
|
9d32b75 to
a6bfcdc
Compare
a6bfcdc to
a616389
Compare
|
Rebased this branch on top of current Validation after rebase: |
Fixes #222.
Summary
STRIX_MAX_CHILD_AGENTSas a runtime setting (0means unlimited).Test verification (RED -> GREEN)
RED on
origin/mainwith only the regression test added:GREEN after the fix:
Fix-reverted proof:
Validation
uv run pytest tests/test_execution.py tests/test_config_loader.py tests/test_runner_root_prompt.py tests/test_runner_rate_limit.py -q->51 passed, 2 warningsuv run ruff check strix/core/execution.py strix/core/runner.py strix/config/settings.py tests/test_execution.py tests/test_config_loader.py tests/test_runner_root_prompt.py tests/test_runner_rate_limit.py-> passuv run ruff format --check strix/core/execution.py strix/core/runner.py strix/config/settings.py tests/test_execution.py tests/test_config_loader.py tests/test_runner_root_prompt.py tests/test_runner_rate_limit.py-> passuv run mypy strix/core/execution.py strix/core/runner.py strix/config/settings.py tests/test_execution.py tests/test_config_loader.py tests/test_runner_root_prompt.py tests/test_runner_rate_limit.py-> passuv run bandit -q -c pyproject.toml strix/core/execution.py strix/core/runner.py strix/config/settings.py-> pass