Skip to content

fix(delegate): make max_concurrent_children configurable + error on excess - #6881

Closed
malaiwah wants to merge 1 commit into
NousResearch:mainfrom
malaiwah:upstream-fix/delegate-max-children-configurable
Closed

fix(delegate): make max_concurrent_children configurable + error on excess#6881
malaiwah wants to merge 1 commit into
NousResearch:mainfrom
malaiwah:upstream-fix/delegate-max-children-configurable

Conversation

@malaiwah

Copy link
Copy Markdown
Contributor

Fixes #6880.

Problem

delegate_task silently truncates batch tasks to MAX_CONCURRENT_CHILDREN (3):

task_list = tasks[:MAX_CONCURRENT_CHILDREN]  # line 559

Model sends 5 tasks, gets results for 3, never told 2 were dropped. Additionally, maxItems: 3 in the JSON schema blocks the model from even attempting >3 tasks.

Fix

  • Replace silent truncation with a clear 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."
  • Make the limit configurable via delegation.max_concurrent_children in config.yaml or DELEGATION_MAX_CONCURRENT_CHILDREN env var
  • Uses the existing _load_config() path for consistent config priority
  • Remove maxItems: 3 from schema — runtime check gives a better error
  • Clamps to min 1, warns on non-integer config values

Backwards 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).

…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
malaiwah force-pushed the upstream-fix/delegate-max-children-configurable branch from 4a7b7a3 to 67f3b3d Compare April 10, 2026 03:09
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #7360. Cherry-picked with authorship preserved. Good fix — silent truncation was a real problem. Thanks!

@teknium1 teknium1 closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delegate_task silently truncates batch tasks beyond MAX_CONCURRENT_CHILDREN

2 participants