feat(mail): support positional message arg in reply command

Allow `gt mail reply <id> "message"` in addition to `-m` flag.
This is a desire-path fix - agents naturally try positional syntax.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/collins
2026-01-21 17:28:47 -08:00
committed by beads/crew/emma
parent f00b0254f2
commit 6616a4726c
2 changed files with 18 additions and 5 deletions

View File

@@ -82,6 +82,17 @@ func runMailThread(cmd *cobra.Command, args []string) error {
func runMailReply(cmd *cobra.Command, args []string) error {
msgID := args[0]
// Get message body from positional arg or flag (positional takes precedence)
messageBody := mailReplyMessage
if len(args) > 1 {
messageBody = args[1]
}
// Validate message is provided
if messageBody == "" {
return fmt.Errorf("message body required: provide as second argument or use -m flag")
}
// All mail uses town beads (two-level architecture)
workDir, err := findMailWorkDir()
if err != nil {
@@ -118,7 +129,7 @@ func runMailReply(cmd *cobra.Command, args []string) error {
From: from,
To: original.From, // Reply to sender
Subject: subject,
Body: mailReplyMessage,
Body: messageBody,
Type: mail.TypeReply,
Priority: mail.PriorityNormal,
ReplyTo: msgID,