fix(worker): broadcast TaskUpdated on queue-claimed task start

QueuePicker's raw-SQL Queued->Running claim bypasses TaskStateService.StartRunningAsync,
the only other place that broadcasts TaskUpdated on this transition, so the task-list
badge stayed on "Queued" until the run finished. Send TaskUpdated for alreadyClaimed
dispatches in TaskRunner.RunAsync/ContinueAsync to close that gap.
This commit is contained in:
mika kuns
2026-08-05 20:53:55 +02:00
parent bdee731376
commit 860201017c
2 changed files with 97 additions and 0 deletions
+15
View File
@@ -129,6 +129,14 @@ public sealed class TaskRunner
return;
}
}
else
{
// Queue-claimed dispatches skip StartRunningAsync (the atomic SQL claim in
// QueuePicker already flipped the row to Running), so it never broadcasts
// TaskUpdated for this transition. Send it here so the task-list badge flips
// live instead of staying on "Queued" until the run finishes.
await _broadcaster.TaskUpdated(task.Id);
}
await _broadcaster.TaskStarted(slot, task.Id, now);
await _skillSeeder.SeedAsync(runDir, resolvedConfig.SkillNames, wtCtx is not null, ct);
@@ -251,7 +259,14 @@ public sealed class TaskRunner
return;
}
}
else
{
// Queue-claimed dispatches skip StartRunningAsync, so broadcast TaskUpdated here
// (see RunAsync for the full rationale).
await _broadcaster.TaskUpdated(taskId);
}
await _broadcaster.TaskStarted(slot, taskId, now);
await _broadcaster.TaskUpdated(taskId);
await _skillSeeder.SeedAsync(runDir, resolvedConfig.SkillNames, wtCtx is not null, ct);