feat(worker): emit WorkerLog for merge, discard, reset

This commit is contained in:
mika kuns
2026-04-23 14:47:45 +02:00
parent ea4d2d7c0c
commit e8056553fd
2 changed files with 3 additions and 0 deletions

View File

@@ -136,6 +136,7 @@ public sealed class TaskMergeService
_logger.LogInformation( _logger.LogInformation(
"Merged task {TaskId} branch {Branch} into {Target} (remove worktree: {Remove})", "Merged task {TaskId} branch {Branch} into {Target} (remove worktree: {Remove})",
taskId, wt.BranchName, targetBranch, removeWorktree); taskId, wt.BranchName, targetBranch, removeWorktree);
await _broadcaster.WorkerLog($"Merged \"{task.Title}\" into {targetBranch}", WorkerLogLevel.Success, DateTime.UtcNow);
return new MergeResult(StatusMerged, Array.Empty<string>(), cleanupWarning); return new MergeResult(StatusMerged, Array.Empty<string>(), cleanupWarning);
} }

View File

@@ -51,6 +51,7 @@ public sealed class TaskResetService
if (wt is not null && wt.State == WorktreeState.Active && list.WorkingDir is not null) if (wt is not null && wt.State == WorktreeState.Active && list.WorkingDir is not null)
{ {
await _wtManager.DiscardAsync(wt, list.WorkingDir, ct); await _wtManager.DiscardAsync(wt, list.WorkingDir, ct);
await _broadcaster.WorkerLog($"Discarded worktree for \"{task.Title}\"", WorkerLogLevel.Warn, DateTime.UtcNow);
worktreeChanged = true; worktreeChanged = true;
} }
@@ -64,5 +65,6 @@ public sealed class TaskResetService
await _broadcaster.WorktreeUpdated(taskId); await _broadcaster.WorktreeUpdated(taskId);
_logger.LogInformation("Reset task {TaskId} to Manual (worktree discarded: {Discarded})", taskId, worktreeChanged); _logger.LogInformation("Reset task {TaskId} to Manual (worktree discarded: {Discarded})", taskId, worktreeChanged);
await _broadcaster.WorkerLog($"Reset \"{task.Title}\"", WorkerLogLevel.Warn, DateTime.UtcNow);
} }
} }