From f8e387bbc110cdbe21dd1c41ba6695eb81e1d459 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Mon, 1 Jun 2026 15:18:27 +0200 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFchore(claude-do):=20Make=20add=5Ftask?= =?UTF-8?q?=20optional=20params=20actually=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add_task currently marks description, createdBy, and queueImmediately as required, forcing callers to invent values for fields that have obvious defaults. Fix: make them optional with sensible defaults — description: null, queueImmediately: false, createdBy: server default like "mcp". Keep only listId and title as truly required. ClaudeDo-Task: b9fadf0b-a20e-4deb-932d-29ef9c0b83f3 --- src/ClaudeDo.Worker/External/ExternalMcpService.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ClaudeDo.Worker/External/ExternalMcpService.cs b/src/ClaudeDo.Worker/External/ExternalMcpService.cs index 4550988..7e811a4 100644 --- a/src/ClaudeDo.Worker/External/ExternalMcpService.cs +++ b/src/ClaudeDo.Worker/External/ExternalMcpService.cs @@ -90,17 +90,15 @@ public sealed class ExternalMcpService public async Task AddTask( string listId, string title, - string? description, - string createdBy, - bool queueImmediately, - CancellationToken cancellationToken) + string? description = null, + string? createdBy = null, + bool queueImmediately = false, + CancellationToken cancellationToken = default) { if (string.IsNullOrWhiteSpace(listId)) throw new InvalidOperationException("listId is required."); if (string.IsNullOrWhiteSpace(title)) throw new InvalidOperationException("title is required."); - if (string.IsNullOrWhiteSpace(createdBy)) - throw new InvalidOperationException("createdBy is required."); var list = await _lists.GetByIdAsync(listId, cancellationToken) ?? throw new InvalidOperationException($"List {listId} not found."); @@ -114,7 +112,7 @@ public sealed class ExternalMcpService Status = TaskStatus.Idle, CreatedAt = DateTime.UtcNow, CommitType = list.DefaultCommitType, - CreatedBy = createdBy, + CreatedBy = createdBy.NullIfBlank() ?? "mcp", }; await _tasks.AddAsync(entity, cancellationToken);