mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 10:02:04 +00:00
* Subagents: restore announce flow and fix nested delivery retries * fix: prep subagent announce + docs alignment (#22223) (thanks @tyler6204)
22 lines
756 B
TypeScript
22 lines
756 B
TypeScript
import type { OpenClawConfig } from "./types.js";
|
|
|
|
export const DEFAULT_AGENT_MAX_CONCURRENT = 4;
|
|
export const DEFAULT_SUBAGENT_MAX_CONCURRENT = 8;
|
|
export const DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH = 2;
|
|
|
|
export function resolveAgentMaxConcurrent(cfg?: OpenClawConfig): number {
|
|
const raw = cfg?.agents?.defaults?.maxConcurrent;
|
|
if (typeof raw === "number" && Number.isFinite(raw)) {
|
|
return Math.max(1, Math.floor(raw));
|
|
}
|
|
return DEFAULT_AGENT_MAX_CONCURRENT;
|
|
}
|
|
|
|
export function resolveSubagentMaxConcurrent(cfg?: OpenClawConfig): number {
|
|
const raw = cfg?.agents?.defaults?.subagents?.maxConcurrent;
|
|
if (typeof raw === "number" && Number.isFinite(raw)) {
|
|
return Math.max(1, Math.floor(raw));
|
|
}
|
|
return DEFAULT_SUBAGENT_MAX_CONCURRENT;
|
|
}
|