Skip to content

feat: configure parallel sub-agent limit via environment - #1364

Merged
thesujai merged 4 commits into
mainfrom
feat/configurable-parallel-subagents
Nov 13, 2026
Merged

thesujai merged 4 commits into
mainfrom
feat/configurable-parallel-subagents

Conversation

@thesujai

@thesujai thesujai commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Linear

AGE-2785 — Increase subagents concurrency limit & make it configurable

Summary

  • Replace the hard-coded parallel sub-agent limit of 5 with MAX_PARALLEL_SUB_AGENTS, defaulting to 10.
  • Read and validate the setting in central server config; reject non-positive/non-integer values at startup.
  • Pass the configured limit through the turn resource resolver into orchestration, including rebuilt turns. Core consumers retain the default when no override is supplied. Validation remains in server config, without a duplicate check in the orchestrator.
  • Document the environment variable in .env.example and include patch changesets for core and server.

Configuration

MAX_PARALLEL_SUB_AGENTS=10

The limit is per turn, preserving existing batching behavior. Unset or blank values use the default of 10.

Validation

  • Passed ESLint on all seven changed TypeScript source files (--max-warnings=0); reran on the orchestrator after the review change.
  • Passed git diff --check.
  • No tests added or run, as requested.

Note

Medium Risk
Raises default sub-agent concurrency and adds an env knob that affects per-turn parallelism and resource load, though behavior is otherwise unchanged and invalid values fail at startup.

Overview
Replaces the hard-coded parallel sub-agent cap (5) with a per-turn, configurable limit that defaults to 10.

MAX_PARALLEL_SUB_AGENTS is read in server config (positive integer validation at startup) and documented in .env.example. The value flows from createTurnResolver → TurnResourceResolver → SessionHandle → AgentThreadOrchestrator, which batches runnable sub-agents using the instance limit instead of a module constant. Core exposes DEFAULT_MAX_PARALLEL_SUB_AGENTS for the default; hosts that omit the resolver override keep that default.

Reviewed by Cursor Bugbot for commit 8f76a6d. Bugbot is set up for automated code reviews on this repo. Configure here.

Default MAX_PARALLEL_SUB_AGENTS to 10 and validate positive integer overrides at startup. Pass the configured limit through turn resource resolution to orchestration.

Co-authored-by: TrueForge Agent <trueforge@truefoundry.com>
@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f76a6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-core Patch
@truefoundry/trueforge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@veria-ai

veria-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

Co-authored-by: TrueForge Agent <trueforge@truefoundry.com>
thesujai and others added 2 commits November 13, 2026 04:47
Omit unset limits when forwarding to preserve exact optional property semantics.

Co-authored-by: TrueForge Agent <trueforge@truefoundry.com>
@thesujai
thesujai enabled auto-merge (squash) November 13, 2026 04:48
@thesujai
thesujai merged commit 4b8a354 into main Nov 13, 2026
13 of 14 checks passed
@thesujai
thesujai deleted the feat/configurable-parallel-subagents branch November 13, 2026 04:52
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.

2 participants