chore(worker): external MCP tools return explicit results instead of empty responses

set_task_config/set_list_config now echo which fields were set vs cleared, get_list_config/get_task_config return an explicit found=false instead of null, and delete_list/run_task_now/reset_failed_task/remove_task_attachment return a confirmation record — matching the found/ok convention already used by batch_get_tasks and get_task_log.
This commit is contained in:
mika kuns
2026-08-05 10:58:28 +02:00
parent 334cf1e1d2
commit c871f35513
11 changed files with 156 additions and 39 deletions
+5 -2
View File
@@ -6,6 +6,8 @@ using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
namespace ClaudeDo.Worker.External;
public sealed record ResetFailedTaskResult(bool Reset, string TaskId);
[McpServerToolType]
public sealed class LifecycleMcpTools
{
@@ -18,8 +20,8 @@ public sealed class LifecycleMcpTools
_reset = reset;
}
[McpServerTool, Description("Reset a failed task: discards its worktree and returns it to Idle so it can be run again. Only Failed tasks are accepted.")]
public async Task ResetFailedTask(string taskId, CancellationToken cancellationToken)
[McpServerTool, Description("Reset a failed task: discards its worktree and returns it to Idle so it can be run again. Only Failed tasks are accepted. Returns { reset: true, taskId } on success.")]
public async Task<ResetFailedTaskResult> ResetFailedTask(string taskId, CancellationToken cancellationToken)
{
var task = await _tasks.GetByIdAsync(taskId, cancellationToken)
?? throw new InvalidOperationException($"Task {taskId} not found.");
@@ -27,5 +29,6 @@ public sealed class LifecycleMcpTools
throw new InvalidOperationException($"Task {taskId} is {task.Status}, not Failed. Only failed tasks can be reset via this tool.");
await _reset.ResetAsync(taskId, cancellationToken);
return new ResetFailedTaskResult(true, taskId);
}
}