feat(runtime): cap spawned child agents - #911
Open
ousamabenyounes wants to merge 2 commits into
Open
Conversation
Contributor
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 |
Contributor
Author
|
Fixed Greptile's concurrency finding in What changed:
Validation:
|
ousamabenyounes
force-pushed
the
feat/issue-222-agent-limit
branch
from
July 27, 2026 20:37
9d32b75 to
a6bfcdc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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