fix: Fix task type starvation in WorkerCommand::processNextTask by shuffling providers

Co-authored-by: marcelklehr <986878+marcelklehr@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-18 07:17:44 +00:00 committed by backportbot[bot]
parent e1208cad4c
commit e84eedde7f

View file

@ -110,6 +110,10 @@ class WorkerCommand extends Base {
*/
private function processNextTask(OutputInterface $output, array $taskTypes = []): bool {
$providers = $this->taskProcessingManager->getProviders();
// Shuffle providers to avoid starvation: if providers are always iterated
// in the same order, a provider with a constant stream of tasks would
// prevent all subsequent providers from ever being processed.
shuffle($providers);
foreach ($providers as $provider) {
if (!$provider instanceof ISynchronousProvider) {