From 1267a1bac50fcb6ee7145ceaef65857d64691c71 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 6 Jan 2026 12:05:26 +0900 Subject: [PATCH] feat(background-agent): support 0 as unlimited concurrency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting concurrency to 0 means unlimited (Infinity). Works for defaultConcurrency, providerConcurrency, and modelConcurrency. 🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/features/background-agent/concurrency.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/features/background-agent/concurrency.ts b/src/features/background-agent/concurrency.ts index 1475fc53..e9d24b8c 100644 --- a/src/features/background-agent/concurrency.ts +++ b/src/features/background-agent/concurrency.ts @@ -10,14 +10,20 @@ export class ConcurrencyManager { } getConcurrencyLimit(model: string): number { - if (this.config?.modelConcurrency?.[model]) { - return this.config.modelConcurrency[model] + const modelLimit = this.config?.modelConcurrency?.[model] + if (modelLimit !== undefined) { + return modelLimit === 0 ? Infinity : modelLimit } const provider = model.split('/')[0] - if (this.config?.providerConcurrency?.[provider]) { - return this.config.providerConcurrency[provider] + const providerLimit = this.config?.providerConcurrency?.[provider] + if (providerLimit !== undefined) { + return providerLimit === 0 ? Infinity : providerLimit } - return this.config?.defaultConcurrency ?? 5 + const defaultLimit = this.config?.defaultConcurrency + if (defaultLimit !== undefined) { + return defaultLimit === 0 ? Infinity : defaultLimit + } + return 5 } async acquire(model: string): Promise {