ofiere-openclaw-plugin 4.56.6 → 4.56.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/tools.js CHANGED
@@ -849,7 +849,8 @@ async function handleCreateTask(supabase, userId, resolveAgent, params, fallback
849
849
  const effectiveAgentId = insertData.agent_id || assignee;
850
850
  if (startDate && effectiveAgentId && normalized) {
851
851
  try {
852
- let { nextRunAtEpoch } = normalized;
852
+ const originalEpoch = normalized.nextRunAtEpoch;
853
+ let nextRunAtEpoch = originalEpoch;
853
854
  const nowEpoch = Math.floor(Date.now() / 1000);
854
855
  // Safety net: if computed time is in the past, schedule for now + 60s
855
856
  // Fix #2 (2026-05-17): jitter past-time bump 0..5min so bulk creates
@@ -886,6 +887,21 @@ async function handleCreateTask(supabase, userId, resolveAgent, params, fallback
886
887
  nextRunAtEpoch += recent * perSlotSecs;
887
888
  }
888
889
  }
890
+ // Fix #3 cosmetic parity (2026-05-17): when either Fix #2 jitter or
891
+ // Fix #3 stagger mutated nextRunAtEpoch, recompute the local-clock
892
+ // display fields so the dashboard UI doesn't show the ORIGINAL T0 for
893
+ // an event that actually fires minutes later. Dispatch uses
894
+ // next_run_at, but users read scheduled_date+scheduled_time.
895
+ let scheduledDateLocalFinal = normalized.scheduledDateLocal;
896
+ let scheduledTimeLocalFinal = normalized.scheduledTimeLocal;
897
+ if (nextRunAtEpoch !== originalEpoch) {
898
+ const offsetMin = Math.round(TZ_OFFSET_HOURS * 60);
899
+ const localMs = nextRunAtEpoch * 1000 + offsetMin * 60 * 1000;
900
+ const localD = new Date(localMs);
901
+ const padN = (n) => String(n).padStart(2, "0");
902
+ scheduledDateLocalFinal = `${localD.getUTCFullYear()}-${padN(localD.getUTCMonth() + 1)}-${padN(localD.getUTCDate())}`;
903
+ scheduledTimeLocalFinal = `${padN(localD.getUTCHours())}:${padN(localD.getUTCMinutes())}`;
904
+ }
889
905
  await supabase.from("scheduler_events").insert({
890
906
  id: crypto.randomUUID(),
891
907
  user_id: userId,
@@ -894,8 +910,8 @@ async function handleCreateTask(supabase, userId, resolveAgent, params, fallback
894
910
  subagent_id: subagentId,
895
911
  title: params.title,
896
912
  description: params.description || params.instructions || null,
897
- scheduled_date: normalized.scheduledDateLocal,
898
- scheduled_time: normalized.scheduledTimeLocal,
913
+ scheduled_date: scheduledDateLocalFinal,
914
+ scheduled_time: scheduledTimeLocalFinal,
899
915
  duration_minutes: 30,
900
916
  recurrence_type: params.recurrence_type || "none",
901
917
  recurrence_interval: params.recurrence_interval || 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "4.56.6",
3
+ "version": "4.56.7",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for Ofiere PM - 18 meta-tools covering tasks, agents, projects, scheduling, knowledge, workflows, notifications, memory, prompts, constellation, space file management, execution plan builder, SOP management, agent brain, talent management, corporate frameworks, agent office canvas, and PM gate approvals",
6
6
  "keywords": [
package/src/tools.ts CHANGED
@@ -946,7 +946,8 @@ async function handleCreateTask(
946
946
  const effectiveAgentId = (insertData.agent_id as string) || assignee;
947
947
  if (startDate && effectiveAgentId && normalized) {
948
948
  try {
949
- let { nextRunAtEpoch } = normalized;
949
+ const originalEpoch = normalized.nextRunAtEpoch;
950
+ let nextRunAtEpoch = originalEpoch;
950
951
  const nowEpoch = Math.floor(Date.now() / 1000);
951
952
  // Safety net: if computed time is in the past, schedule for now + 60s
952
953
  // Fix #2 (2026-05-17): jitter past-time bump 0..5min so bulk creates
@@ -985,6 +986,22 @@ async function handleCreateTask(
985
986
  }
986
987
  }
987
988
 
989
+ // Fix #3 cosmetic parity (2026-05-17): when either Fix #2 jitter or
990
+ // Fix #3 stagger mutated nextRunAtEpoch, recompute the local-clock
991
+ // display fields so the dashboard UI doesn't show the ORIGINAL T0 for
992
+ // an event that actually fires minutes later. Dispatch uses
993
+ // next_run_at, but users read scheduled_date+scheduled_time.
994
+ let scheduledDateLocalFinal = normalized.scheduledDateLocal;
995
+ let scheduledTimeLocalFinal = normalized.scheduledTimeLocal;
996
+ if (nextRunAtEpoch !== originalEpoch) {
997
+ const offsetMin = Math.round(TZ_OFFSET_HOURS * 60);
998
+ const localMs = nextRunAtEpoch * 1000 + offsetMin * 60 * 1000;
999
+ const localD = new Date(localMs);
1000
+ const padN = (n: number) => String(n).padStart(2, "0");
1001
+ scheduledDateLocalFinal = `${localD.getUTCFullYear()}-${padN(localD.getUTCMonth() + 1)}-${padN(localD.getUTCDate())}`;
1002
+ scheduledTimeLocalFinal = `${padN(localD.getUTCHours())}:${padN(localD.getUTCMinutes())}`;
1003
+ }
1004
+
988
1005
  await supabase.from("scheduler_events").insert({
989
1006
  id: crypto.randomUUID(),
990
1007
  user_id: userId,
@@ -993,8 +1010,8 @@ async function handleCreateTask(
993
1010
  subagent_id: subagentId,
994
1011
  title: params.title,
995
1012
  description: (params.description as string) || (params.instructions as string) || null,
996
- scheduled_date: normalized.scheduledDateLocal,
997
- scheduled_time: normalized.scheduledTimeLocal,
1013
+ scheduled_date: scheduledDateLocalFinal,
1014
+ scheduled_time: scheduledTimeLocalFinal,
998
1015
  duration_minutes: 30,
999
1016
  recurrence_type: (params.recurrence_type as string) || "none",
1000
1017
  recurrence_interval: (params.recurrence_interval as number) || 1,