feat(worker): surface task numbers in MCP tool return payloads

Adds Number alongside every task id in External/'s DTOs -- the two
central mappers (ToDto/ToRefDto -> TaskDto/TaskRefDto) plus every
DTO that carries a bare task id and bypasses them (batch results,
queue state, wait-for-change, config, attachments, handoff,
lifecycle, merge-preview-set, worktree list). Input resolution
(#123 as an argument) stays for slice 3.
This commit is contained in:
mika kuns
2026-08-11 11:59:51 +02:00
parent 8da1a12389
commit 106c964410
12 changed files with 129 additions and 64 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ using ModelContextProtocol.Server;
namespace ClaudeDo.Worker.External;
public sealed record HandoffListHandlerResult(bool Requested, string TaskId, int SurvivingCount, string NextPhase);
public sealed record HandoffListHandlerResult(bool Requested, string TaskId, int Number, int SurvivingCount, string NextPhase);
[McpServerToolType]
public sealed class HandoffMcpTools
@@ -40,7 +40,7 @@ public sealed class HandoffMcpTools
if (survivingTaskIds.Count == 0)
throw new InvalidOperationException("survivingTaskIds must contain at least one task id.");
_ = await _tasks.GetByIdAsync(taskId, cancellationToken)
var task = await _tasks.GetByIdAsync(taskId, cancellationToken)
?? throw new InvalidOperationException($"Task {taskId} not found.");
foreach (var id in survivingTaskIds)
@@ -48,6 +48,6 @@ public sealed class HandoffMcpTools
?? throw new InvalidOperationException($"Task {id} not found.");
await _broadcaster.HandoffRequested(taskId, survivingTaskIds, nextPhase);
return new HandoffListHandlerResult(true, taskId, survivingTaskIds.Count, nextPhase);
return new HandoffListHandlerResult(true, taskId, task.Number, survivingTaskIds.Count, nextPhase);
}
}