From 2295cbb81550e2362e99cc88d796a2990ecbb62c Mon Sep 17 00:00:00 2001 From: Rolf Fredheim Date: Thu, 25 Dec 2025 10:05:15 +0000 Subject: [PATCH] feat(agent): add maxConcurrent config for parallel message handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `agent.maxConcurrent` config option to control how many agent runs can execute in parallel across all conversations. Default remains 1 (sequential) for backwards compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/config/config.ts | 3 +++ src/gateway/server.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/config/config.ts b/src/config/config.ts index ab31d041d..56735a3ad 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -325,6 +325,8 @@ export type ClawdisConfig = { typingIntervalSeconds?: number; /** Periodic background heartbeat runs (minutes). 0 disables. */ heartbeatMinutes?: number; + /** Max concurrent agent runs across all conversations. Default: 1 (sequential). */ + maxConcurrent?: number; /** Bash tool defaults. */ bash?: { /** Default time (ms) before a bash command auto-backgrounds. */ @@ -582,6 +584,7 @@ const ClawdisSchema = z.object({ mediaMaxMb: z.number().positive().optional(), typingIntervalSeconds: z.number().int().positive().optional(), heartbeatMinutes: z.number().nonnegative().optional(), + maxConcurrent: z.number().int().positive().optional(), bash: z .object({ backgroundMs: z.number().int().positive().optional(), diff --git a/src/gateway/server.ts b/src/gateway/server.ts index de97ad17c..ab2767ffd 100644 --- a/src/gateway/server.ts +++ b/src/gateway/server.ts @@ -1736,6 +1736,7 @@ export async function startGatewayServer( { controller: AbortController; sessionId: string; sessionKey: string } >(); setCommandLaneConcurrency("cron", cfgAtStart.cron?.maxConcurrentRuns ?? 1); + setCommandLaneConcurrency("main", cfgAtStart.agent?.maxConcurrent ?? 1); const cronStorePath = resolveCronStorePath(cfgAtStart.cron?.store); const cronLogger = getChildLogger({