From 9cb24a5306cd72e45c1876caefd63fe6ada5ffcf Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 25 Nov 2026 09:40:19 +0100 Subject: [PATCH] fix: a duplicated automation loses the start date of its schedule (#35047) Duplicating an automation whose repeating schedule has a start date, such as one the model created in a chat, saved the copy without that start date. A copy of a schedule meant to start later began running right away, so it ran on other dates than the original. The copy now keeps the schedule exactly as it was unless the schedule is changed before the copy is created. Fixes #35044 --- src/lib/components/AutomationModal.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/components/AutomationModal.svelte b/src/lib/components/AutomationModal.svelte index 719a0e8c9c..aa43aa8406 100644 --- a/src/lib/components/AutomationModal.svelte +++ b/src/lib/components/AutomationModal.svelte @@ -104,6 +104,7 @@ // Schedule dropdown ref let scheduleDropdown: ScheduleDropdown; + let savedRrule = ''; $: allowWebhook = !!$config?.features?.enable_automation_webhooks; const submitHandler = async () => { @@ -128,13 +129,16 @@ } loading = true; try { + const rrule = scheduleDropdown.buildRrule(); + const sourceRrule = (automation ?? cloneFrom)?.data.rrule; const form: AutomationForm = { name: name.trim(), folder_id: target_type === 'channel' ? null : folder_id || null, data: { prompt: prompt.trim(), model_id: model_id.trim(), - rrule: scheduleDropdown.buildRrule(), + // An untouched schedule keeps its stored start date. + rrule: sourceRrule && rrule === savedRrule ? sourceRrule : rrule, webhook: webhookEnabled ? { allow_get: webhookAllowGet } : null, machine: machineServerId ? { server_id: machineServerId, cwd: machineCwd.trim() || undefined } @@ -227,6 +231,7 @@ webhookEnabled = false; webhookAllowGet = false; } + savedRrule = scheduleDropdown?.buildRrule?.() ?? ''; initialized = true; };