feat(agents): lower default agent parallelism from 24 to 10

Each unit of parallelism is a full agent subprocess per agent x community
pair, spawned eagerly at create/start. At 24, a desktop with a few dozen
pairs can carry over a thousand potential idle subprocesses, and slow-
starting harnesses (e.g. OpenClaw at 4-10s per worker) take minutes to
create because the pool initializes serially before the relay connects.

10 still covers concurrent-channel fan-out for typical agents (parallelism
is per-channel concurrency; most agents are active in far fewer than 10
channels at once) while cutting the eager startup cost and idle process
fleet by more than half. Existing records keep their persisted value;
only new records and unset defaults are affected. Per-agent override is
unchanged (1..=32 via the agent editor).

Demand-driven pool growth (seed 1, grow on contention) is tracked as a
follow-up.

Test comments in activeAgentTurnsStore.test.mjs updated: the 24-turn case
is now framed against the user-configurable harness cap (32) rather than
the default, so the test keeps its coverage without pinning the default.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
This commit is contained in:
npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d
2026-07-26 17:19:44 -04:00
co-authored by Tyler Longwell
parent 1a56b7cc9e
commit 63bb0c1c46
2 changed files with 8 additions and 5 deletions
@@ -745,7 +745,7 @@ pub struct UpdateTeamRequest {
pub const DEFAULT_ACP_COMMAND: &str = "buzz-acp";
/// ~5 min (320s) — matches the CLI harness default (BUZZ_ACP_IDLE_TIMEOUT).
pub const DEFAULT_AGENT_TURN_TIMEOUT_SECONDS: u64 = 320;
pub const DEFAULT_AGENT_PARALLELISM: u32 = 24;
pub const DEFAULT_AGENT_PARALLELISM: u32 = 10;
fn default_agent_parallelism() -> u32 {
DEFAULT_AGENT_PARALLELISM
@@ -157,7 +157,9 @@ describe("activeAgentTurnsStore", () => {
// Mirrors the store's private cap: the harness's hard upper bound on
// parallel agent subprocesses (`--agents` accepts 1..=32).
const CAP = 32;
/** Desktop's default harness parallelism (DEFAULT_AGENT_PARALLELISM). */
/** Desktop's former default harness parallelism; still a legitimate
* per-agent turn count (any value up to the harness cap of 32 is valid,
* regardless of DEFAULT_AGENT_PARALLELISM). */
const DEFAULT_PARALLELISM = 24;
const EPOCH = Date.parse("2024-01-01T00:00:00Z");
const at = (ms) => new Date(EPOCH + ms).toISOString();
@@ -188,9 +190,10 @@ describe("activeAgentTurnsStore", () => {
assert.ok(channels.has(`c${CAP + 1}`));
});
it("tracks every turn of a default-parallelism agent working in 24 channels", () => {
// DEFAULT_AGENT_PARALLELISM is 24, so a single agent legitimately runs 24
// concurrent turns. Every one must keep its working badge.
it("tracks every turn of a high-parallelism agent working in 24 channels", () => {
// Parallelism up to the harness cap (32) is user-configurable, so a
// single agent can legitimately run 24 concurrent turns. Every one
// must keep its working badge.
syncAgentTurnsFromEvents(AGENT, startTurns(DEFAULT_PARALLELISM));
const channels = channelIdsOf(getActiveTurnsForAgent(AGENT));
assert.equal(