summaryrefslogtreecommitdiffhomepage
path: root/packaging/dispatch-api-wrapper.sh
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-01 09:53:12 +0900
committerAdam Malczewski <[email protected]>2026-06-01 09:53:12 +0900
commit1c800eb35b48b28a82a64e8b2b3ce666323f2c42 (patch)
treec26044a38f0099fbbe98680a02b73bc2417f1eb0 /packaging/dispatch-api-wrapper.sh
parentc351719ec81a1b87565abc0656756f4aa9e473d0 (diff)
downloaddispatch-1c800eb35b48b28a82a64e8b2b3ce666323f2c42.tar.gz
dispatch-1c800eb35b48b28a82a64e8b2b3ce666323f2c42.zip
feat(wake): probe 4 times per marked hour (:00 :15 :30 :45), coalesce same-tick fires
Marking an hour on the Claude Wake Schedule panel now schedules FOUR probes within that hour instead of one. Rate-window edges are unforgiving — a single probe at :15 can miss the actual reset moment by up to 14 minutes; hitting :00 / :15 / :30 / :45 puts us within ~7 minutes of any reset that happens during that hour. When multiple slots come due in the same 30s scheduler tick (or recover together at boot), they coalesce into a SINGLE upstream wake call — no point hitting Anthropic 4× in the same window. DB schema - wake_schedule is now (hour, slot_minute, next_wake_at) PK (hour, slot_minute). Destructive migration: detect old single-row-per-hour schema by absence of the slot_minute column and DROP TABLE. No other table is touched. Per user direction: no back-compat for old rows. API - POST /models/wake-schedule/toggle add: { hour, timestamps: { '0': ms, '15': ms, '30': ms, '45': ms } } — all 4 slots required, all must be future Unix ms. Delete shape unchanged ({ hour }). - GET /models/wake-schedule shape: schedule: { '9': { '0': ts, '15': ts, '30': ts, '45': ts }, ... } probeSlotMinutes: [0, 15, 30, 45] resetOffsetHours, lastWake, pendingRetry (unchanged from prior commit) Frontend - Computes 4 timestamps client-side (next occurrence of HH:MM in local TZ) and sends them in one request. - markedHours summary now says 'Probes :00 :15 :30 :45 → reset by ~Xh later'. - Same in-flight tracking / current-hour ring / status row as before. Tests - wake-scheduler.test.ts unchanged (pure helpers still correct; added PROBE_SLOT_MINUTES + isProbeSlotMinute exports). - routes.test.ts rewritten for the new payload shape: 12 wake-schedule tests covering snapshot shape, add/remove (full 4-slot round-trip), validation (range, integer, past-slot, missing slot, non-object, missing timestamps), independent multi-hour scheduling, and re-toggle replacement. 417 tests total (was 414).
Diffstat (limited to 'packaging/dispatch-api-wrapper.sh')
0 files changed, 0 insertions, 0 deletions