From 5beb39a3338e83c9a5906d2e5f7acb3bf795811d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Mar 2026 22:41:39 +0200 Subject: fix: prevent ask add from swallowing tags into descriptions, add rc.confirmation=off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parseAddArgs now rejects args that start with '+'/'-' but contain spaces as modifiers — those are description text, not tags (tags cannot have spaces). This prevents agents from quoting tag+description together and having the tag silently land in the task description with no tag applied. Also removed the fallthrough that duplicated all-modifier args as description. Added rc.confirmation=off to every taskwarrior invocation so that write operations (done, delete, start, etc.) succeed non-interactively when stdin is unavailable (as is always the case when called from an agent). Bump version to v0.25.11. Co-Authored-By: Claude Sonnet 4.6 --- internal/askcli/command_info_add.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'internal/askcli/command_info_add.go') diff --git a/internal/askcli/command_info_add.go b/internal/askcli/command_info_add.go index 0de9be5..2680163 100644 --- a/internal/askcli/command_info_add.go +++ b/internal/askcli/command_info_add.go @@ -70,15 +70,22 @@ func extractUUIDFromAddOutput(output string) string { return "" } +// parseAddArgs splits args into taskwarrior modifier tokens and the description. +// Modifier tokens are args that start with "priority:", "+", or "-" AND contain +// no spaces (tags and priority flags cannot have spaces). The first arg that is +// not a modifier begins the description; all remaining args are joined with spaces. +// If all args are modifiers the description is empty. func parseAddArgs(args []string) (modifiers []string, description string) { for i, arg := range args { - if strings.HasPrefix(arg, "priority:") || strings.HasPrefix(arg, "+") || strings.HasPrefix(arg, "-") { + isModifier := !strings.Contains(arg, " ") && + (strings.HasPrefix(arg, "priority:") || strings.HasPrefix(arg, "+") || strings.HasPrefix(arg, "-")) + if isModifier { modifiers = append(modifiers, arg) } else { description = strings.Join(args[i:], " ") return } } - description = strings.Join(args, " ") + // All args were modifiers; no description provided. return } -- cgit v1.2.3