You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: automation schedules run in the rule's resolved timezone, not UTC
The automation create/update help text and the automation skill card
claimed schedules are always stored and evaluated in UTC, and told
callers to convert local wall-clock times to UTC before passing them
to --at or --cron-expr.
The API resolves a rule's timezone from the caller's member timezone,
then the account timezone, falling back to UTC only when neither is
set. Since the curated create/update commands never send a timezone,
following the old advice and pre-converting to UTC shifts the schedule
by the account's UTC offset instead of producing the intended
wall-clock time.
Rewrite the help text and skill card prose to say: pass the local time
directly, and use the safari automation-rule-create --timezone flag to
pin a specific timezone when the caller's default isn't wanted (create
only; update cannot change a rule's timezone).
Copy file name to clipboardExpand all lines: internal/cli/automation.go
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ import (
13
13
)
14
14
15
15
constautomationHTTPPostOnlyCron="0 0 * * *"
16
-
constautomationUTCNote="Convert local wall-clock requests to UTC before passing --at or --cron-expr."
16
+
constautomationTimezoneNote="The rule's timezone defaults to the caller's member timezone, then the account timezone; pass the user's local wall-clock time here, do not convert it to UTC."
17
17
18
18
funcnewAutomationCmd() *cobra.Command {
19
19
cmd:=newGroupCmd("automation", "Manage AI SRE Automations")
@@ -60,9 +60,11 @@ By default the rule is enabled. Use --disabled only when the user explicitly
60
60
asks to create it disabled. team_id=0 means personal scope; --team-id >0 creates
61
61
the rule under that team. The scope is immutable after creation.
62
62
63
-
Schedule helpers build a 5-field UTC cron expression. --at and --cron-expr are
64
-
interpreted in UTC, not the caller's local timezone. Convert local wall-clock
65
-
requests to UTC before passing --at or --cron-expr.
63
+
Schedule helpers build a 5-field cron expression evaluated in the rule's
64
+
timezone, which defaults to the caller's member timezone, then the account
65
+
timezone. Pass the user's local wall-clock time to --at or --cron-expr;
66
+
do not convert it to UTC first. This command has no --timezone flag; use
67
+
safari automation-rule-create --timezone to pin a different one.
66
68
67
69
For HTTP POST-only rules, pass --http-post-trigger without a schedule; the CLI
68
70
sends a valid placeholder cron and disables the schedule trigger.`, "Automations", "RuleWriteCreate"),
@@ -111,10 +113,10 @@ the rule under that team. The scope is immutable after creation.
Copy file name to clipboardExpand all lines: skills/flashduty/reference/automation.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,14 @@ Prereq: `SKILL.md` read. Automations create AI SRE sessions on a schedule or thr
29
29
## Scheduling
30
30
31
31
- Default create behavior: enabled immediately. Use `--disabled` only if the user asks for a disabled Automation.
32
-
-No timezone flag is exposed by the current API. Automation schedules are stored and sent as UTC cron.
33
-
-If the user asks for a local wall-clock schedule, first identify the intended timezone from the session context, runner `date`, or the user's wording. Convert that local time to UTC before calling the CLI. If the timezone is unclear, ask before creating or updating the schedule.
34
-
- Helper schedules:
35
-
-`--schedule hourly --at 00:15` -> minute 15 of every UTC hour.
36
-
-`--schedule daily --at 01:30` -> every day at 01:30 UTC.
37
-
-`--schedule weekly --weekday mon --at 02:00` -> every Monday at 02:00 UTC.
38
-
- For exact minute-level control, use `--cron-expr '<minute> <hour> <day> <month> <weekday>'` in UTC.
39
-
-Example: Asia/Shanghai 11:00 is UTC 03:00, so use `--schedule daily --at 03:00` or `--cron-expr "0 3 * * *"`.
32
+
-`create`/`update` expose no `--timezone` flag. The cron expression runs in the rule's timezone, which the server resolves from the caller's member timezone, then the account timezone, falling back to UTC only when neither is set.
33
+
-Pass the user's local wall-clock time directly to `--at` or `--cron-expr` — do not convert it to UTC first. The rule already runs in the caller's own resolved timezone, so a manual UTC conversion shifts the schedule by the account's UTC offset.
34
+
- Helper schedules (times are in the rule's resolved timezone, not UTC):
35
+
-`--schedule hourly --at 00:15` -> minute 15 of every hour.
36
+
-`--schedule daily --at 01:30` -> every day at 01:30.
37
+
-`--schedule weekly --weekday mon --at 02:00` -> every Monday at 02:00.
38
+
- For exact minute-level control, use `--cron-expr '<minute> <hour> <day> <month> <weekday>'` in that same local time.
39
+
-To pin a rule to a specific timezone (e.g. UTC) regardless of the caller's default, use `safari automation-rule-create --timezone <IANA tz>` instead — the curated `create`/`update` commands cannot set it, and `update` cannot change it after creation.
40
40
- HTTP POST-only rule: pass `--http-post-trigger` without schedule flags. The CLI sends a placeholder cron and disables the schedule trigger.
0 commit comments