fix(delegate): make max_concurrent_children configurable + error on excess - #6881
Closed
malaiwah wants to merge 1 commit into
Closed
fix(delegate): make max_concurrent_children configurable + error on excess#6881malaiwah wants to merge 1 commit into
malaiwah wants to merge 1 commit into
Conversation
malaiwah
force-pushed
the
upstream-fix/delegate-max-children-configurable
branch
from
April 10, 2026 02:33
2b2efd3 to
4a7b7a3
Compare
…xcess `delegate_task` silently truncated batch tasks to 3 — the model sends 5 tasks, gets results for 3, never told 2 were dropped. Now returns a clear tool_error explaining the limit and how to fix it. The limit is configurable via: - delegation.max_concurrent_children in config.yaml (priority 1) - DELEGATION_MAX_CONCURRENT_CHILDREN env var (priority 2) - default: 3 Uses the same _load_config() path as the rest of delegate_task for consistent config priority. Clamps to min 1, warns on non-integer config values. Also removes the hardcoded maxItems: 3 from the JSON schema — the schema was blocking the model from even attempting >3 tasks before the runtime check could fire. The runtime check gives a much more actionable error message. Backwards compatible: default remains 3, existing configs unchanged.
malaiwah
force-pushed
the
upstream-fix/delegate-max-children-configurable
branch
from
April 10, 2026 03:09
4a7b7a3 to
67f3b3d
Compare
Contributor
|
Merged via PR #7360. Cherry-picked with authorship preserved. Good fix — silent truncation was a real problem. Thanks! |
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 #6880.
Problem
delegate_tasksilently truncates batch tasks toMAX_CONCURRENT_CHILDREN(3):Model sends 5 tasks, gets results for 3, never told 2 were dropped. Additionally,
maxItems: 3in the JSON schema blocks the model from even attempting >3 tasks.Fix
tool_error: "Too many tasks: 5 provided, but max_concurrent_children is 3. Either reduce the task count, split into multiple delegate_task calls, or increase delegation.max_concurrent_children in config.yaml."delegation.max_concurrent_childrenin config.yaml orDELEGATION_MAX_CONCURRENT_CHILDRENenv var_load_config()path for consistent config prioritymaxItems: 3from schema — runtime check gives a better errorBackwards compatibility
Default remains 3. Existing configs are unchanged. The only behavior change is that exceeding the limit now returns an error instead of silently dropping tasks — strictly better for the model.
Diff
~40 lines, single file (
tools/delegate_tool.py).