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:
committed by
GitHub
parent
65214b7693
commit
4486e0e7bd
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user