feat(worker): add PlanningMergeOrchestrator.ContinueAsync to resume merge after conflict

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-04-24 18:15:19 +02:00
parent ef070ddab5
commit 7d87c03cfa
2 changed files with 85 additions and 0 deletions

View File

@@ -64,6 +64,24 @@ public sealed class PlanningMergeOrchestrator
await DrainAsync(planningTaskId, ct);
}
public async Task ContinueAsync(string planningTaskId, CancellationToken ct)
{
if (!_states.TryGetValue(planningTaskId, out var state) || state.CurrentSubtaskId is null)
throw new InvalidOperationException("no in-progress merge to continue");
var current = state.CurrentSubtaskId;
var result = await _merge.ContinueMergeAsync(current, ct);
if (result.Status != TaskMergeService.StatusMerged)
{
await _broadcaster.PlanningMergeConflict(planningTaskId, current, result.ConflictFiles);
return;
}
await _broadcaster.PlanningSubtaskMerged(planningTaskId, current);
state.CurrentSubtaskId = null;
await DrainAsync(planningTaskId, ct);
}
private async Task DrainAsync(string planningTaskId, CancellationToken ct)
{
if (!_states.TryGetValue(planningTaskId, out var state)) return;