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
+4 -2
View File
@@ -10,6 +10,7 @@ using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
namespace ClaudeDo.Worker.External;
public sealed record AttachmentDto(string FileName, long ByteSize, DateTime CreatedAt);
public sealed record RemoveAttachmentResult(bool Removed, string TaskId, string FileName);
[McpServerToolType]
public sealed class AttachmentMcpTools
@@ -103,8 +104,8 @@ public sealed class AttachmentMcpTools
[McpServerTool, Description(
"Remove a single attachment from a task. Deletes both the file on disk and the database record. " +
"Refuses if the task is currently Running — cancel it first.")]
public async Task RemoveTaskAttachment(
"Refuses if the task is currently Running — cancel it first. Returns { removed: true, taskId, fileName } on success.")]
public async Task<RemoveAttachmentResult> RemoveTaskAttachment(
string taskId, string fileName, CancellationToken ct = default)
{
var task = await _tasks.GetByIdAsync(taskId, ct)
@@ -115,5 +116,6 @@ public sealed class AttachmentMcpTools
_store.DeleteFile(taskId, fileName);
await _attachments.DeleteAsync(taskId, fileName, ct);
await _broadcaster.TaskUpdated(taskId);
return new RemoveAttachmentResult(true, taskId, fileName);
}
}