feat(agents): Swarm core — collector spawn, agents_wait, structured output, caps (gated) (#110932)

* docs: add Swarm implementation spec

* feat(agents): Swarm core — collector spawn, agents_wait, structured output, fastMode, caps

Implements docs/plan/swarms.md §4-6: tools.swarm config gate (default off),
collector-mode sessions_spawn (collect/outputSchema/fastMode/groupId), fail-closed
child approvals, agents_wait race-semantics tool, per-group FIFO scheduler with
maxConcurrent/maxChildrenPerGroup/maxTotalPerGroup caps, additive registry and
state-schema columns (no schema-version bump), and colocated tests.

Part of #110325

* fix(agents): rebase reconciliation — preserve swarm state columns

* fix(agents): O(1) collector session index, cheap-first preflight, collector start lifecycle hooks

Autoreview findings: replace the per-request full registry scan with an
index-maintaining run map and gate the persisted-store fallback behind
isSubagentSessionKey; emit subagent_progress/subagent_spawned from the swarm
scheduler start callback so collector children produce balanced plugin
lifecycle events.

* chore(protocol): regenerate Swift gateway models for swarm fields

* fix(agents): lint cleanup — typed catch, explicit microtask flush, no executor return

* fix(agents): knip/test-support/max-lines cleanup for swarm surfaces

* fix(agents): keep tool-catalog ui-safe — callers pass prepared swarmEnabled fact

resolveSwarmConfig value-import in tool-catalog dragged the server graph into
the Control UI bundle via tool-policy-shared (UNLOADABLE_DEPENDENCY on
subpath aliases). Catalog stays pure; the gateway tools-catalog handler
resolves the gate and passes the boolean.

* fix(agents): reconcile swarm spawn pipeline

* fix(agents): refresh swarm tool metadata

* fix(apps): sync swarm tool localization

* style(agents): compact tool display metadata

* fix(plugin-sdk): account for swarm config surface
This commit is contained in:
Peter Steinberger
2026-07-18 23:30:11 -07:00
committed by GitHub
parent 7055ed578d
commit ccb147518c
115 changed files with 6655 additions and 598 deletions
+6 -3
View File
@@ -115,7 +115,8 @@ const defaultPublicDeprecatedExportsByEntrypointBudget = Object.freeze({
"config-runtime": 123,
"config-contracts": 1,
// +1 each: unified implicit-mention config and AgentThinkingLevel types.
"config-types": 427,
// +1: SwarmConfig mirrors the public tools.swarm config contract.
"config-types": 428,
"config-schema": 3,
"reply-dedupe": 1,
"inbound-reply-dispatch": 26,
@@ -280,7 +281,8 @@ export function readPluginSdkSurfaceBudgets(env = process.env) {
// +1: AgentThinkingLevel shared by default-turn and compaction config.
// +9: shared ingress monitor factory and lifecycle/result contracts across
// channel-outbound and its two deprecated compatibility barrels.
8177,
// +1: SwarmConfig exposes the tools.swarm contract through config-types.
8178,
env,
),
publicFunctionExports: readPluginSdkSurfaceBudgetEnv(
@@ -347,7 +349,8 @@ export function readPluginSdkSurfaceBudgets(env = process.env) {
// +1: AgentModelPolicyConfig mirrored by deprecated config-types.
// +6: ingress monitor lifecycle/result contracts through deprecated channel barrels.
// +1: AgentThinkingLevel mirrored by deprecated config-types.
3013,
// +1: SwarmConfig mirrored by deprecated config-types.
3014,
env,
),
publicWildcardReexports: readPluginSdkSurfaceBudgetEnv(