fix(mcp): merge_task marks the task Done after a successful merge

merge_task only flipped the worktree to Merged; it never transitioned the task
status. With allowWaitingForReview this left a merged task stuck in
WaitingForReview. Approve it to Done on a successful merge (a Done task is
already terminal). Mirrors the ApproveAndMergeAsync review flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-09 10:36:26 +02:00
parent f5d165baae
commit ca8326c4c5
2 changed files with 27 additions and 0 deletions

View File

@@ -468,6 +468,12 @@ public sealed class ExternalMcpService
if (result.Status == TaskMergeService.StatusMerged)
{
// MergeAsync only flips the worktree to Merged; a merged task must also
// reach Done. If it was still awaiting review, approve it now (a Done task
// is already terminal and needs no transition).
if (task.Status == TaskStatus.WaitingForReview)
await _state.ApproveReviewAsync(taskId, cancellationToken);
string? mergeCommit = null;
try
{