fix(agent): released ollama-cloud semaphore slot when waiter aborts
Semaphore.acquire now accepts an AbortSignal so a queued waiter that is cancelled (parent task abort, wall-clock budget elapsing) removes itself from the wait queue instead of being resolved by the next release. The provider semaphore in runSubprocess passes the run's abortSignal through, preventing aborted ollama-cloud subagents from permanently draining the provider concurrency budget. Fixes #3464
This commit is contained in:
@@ -1991,9 +1991,8 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
if (model) {
|
||||
providerSemaphore = getProviderSemaphore(settings, model.provider);
|
||||
if (providerSemaphore) {
|
||||
await awaitAbortable(providerSemaphore.acquire());
|
||||
await providerSemaphore.acquire(abortSignal);
|
||||
providerSemaphoreAcquired = true;
|
||||
checkAbort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user