fix(rpc): add --due and --defer handling to daemon mode (GH#952) (#953)

Reviewed by beads/crew/wolf. Fixes daemon mode silently ignoring --due and --defer flags. Adds comprehensive tests including TestDualPathParity for regression prevention.
This commit is contained in:
Peter Chanthamynavong
2026-01-08 14:36:47 -08:00
committed by GitHub
parent 65214b7693
commit 4486e0e7bd
3 changed files with 752 additions and 7 deletions

View File

@@ -430,8 +430,8 @@ var createCmd = &cobra.Command{
EventActor: eventActor,
EventTarget: eventTarget,
EventPayload: eventPayload,
DueAt: dueStr,
DeferUntil: deferStr,
DueAt: formatTimeForRPC(dueAt),
DeferUntil: formatTimeForRPC(deferUntil),
}
resp, err := daemonClient.Create(createArgs)
@@ -877,3 +877,12 @@ func findTownBeadsDir() (string, error) {
return "", fmt.Errorf("no routes.jsonl found in any parent .beads directory")
}
// formatTimeForRPC converts a *time.Time to RFC3339 string for daemon RPC calls.
// Returns empty string if t is nil, allowing the daemon to distinguish "not set" from "set to zero".
func formatTimeForRPC(t *time.Time) string {
if t == nil {
return ""
}
return t.Format(time.RFC3339)
}