mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
ccb147518c
* 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
35 lines
905 B
TypeScript
35 lines
905 B
TypeScript
export * from "./subagent-spawn.js";
|
|
|
|
type SpawnRuntime = typeof import("./subagent-spawn.runtime.js");
|
|
type SpawnDeps = Omit<
|
|
Pick<
|
|
SpawnRuntime,
|
|
| "callGateway"
|
|
| "dispatchGatewayMethodInProcess"
|
|
| "ensureContextEnginesInitialized"
|
|
| "forkSessionEntryFromParent"
|
|
| "getGlobalHookRunner"
|
|
| "getRuntimeConfig"
|
|
| "hasInProcessGatewayContext"
|
|
| "loadModelCatalog"
|
|
| "resolveContextEngine"
|
|
>,
|
|
"getGlobalHookRunner"
|
|
> & {
|
|
getGlobalHookRunner: () => import("../plugins/hooks.js").SubagentLifecycleHookRunner | null;
|
|
};
|
|
|
|
type Testing = {
|
|
setDepsForTest(overrides?: Partial<SpawnDeps>): void;
|
|
};
|
|
|
|
function getTesting(): Testing {
|
|
return (globalThis as Record<PropertyKey, unknown>)[
|
|
Symbol.for("openclaw.subagentSpawnTestApi")
|
|
] as Testing;
|
|
}
|
|
|
|
export const testing: Testing = {
|
|
setDepsForTest: (overrides) => getTesting().setDepsForTest(overrides),
|
|
};
|