fix(worker): queue dispatches skip the StartRunning re-claim

The picker claims Queued->Running atomically before dispatch; the new
StartRunningAsync guard then rejected every queue-dispatched run. Add
alreadyClaimed to RunAsync/ContinueAsync (queue passes true, override
slot keeps the guard) and align the routing tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-09 23:59:56 +02:00
co-authored by Claude Fable 5
parent 0cba9f9640
commit 74ca2e0dcd
3 changed files with 24 additions and 15 deletions
+3 -3
View File
@@ -191,14 +191,14 @@ public sealed class QueueService : BackgroundService
if (sessionId is not null)
{
await _runner.ContinueAsync(taskId, feedback, "queue", ct);
await _runner.ContinueAsync(taskId, feedback, "queue", ct, alreadyClaimed: true);
}
else
{
task.Description = string.IsNullOrWhiteSpace(task.Description)
? $"Reviewer feedback: {feedback}"
: $"{task.Description}\n\nReviewer feedback: {feedback}";
await _runner.RunAsync(task, "queue", ct);
await _runner.RunAsync(task, "queue", ct, alreadyClaimed: true);
}
// Clear the consumed feedback only once the run reached a successful
@@ -212,7 +212,7 @@ public sealed class QueueService : BackgroundService
return;
}
await _runner.RunAsync(task, "queue", ct);
await _runner.RunAsync(task, "queue", ct, alreadyClaimed: true);
}
catch (Exception ex)
{