Fix bot routine scheduling field mismatch and add debug logging

Bot was sending days_of_week/times but API expects days/time, so
bot-scheduled routines never got reminders. Also handle NULL frequency
from pre-migration rows and add detailed logging to routine reminder
checks for diagnosing further issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 00:21:22 -06:00
parent e89656a87c
commit 019561e7cd
2 changed files with 18 additions and 6 deletions

View File

@@ -217,12 +217,13 @@ async def handle_routine(message, session, parsed):
await message.channel.send("When should this routine be scheduled? (e.g., 'Monday Wednesday Friday at 7am')")
return
# Build schedule data
# Build schedule data (API expects "days" and "time")
schedule_data = {}
if days_of_week:
schedule_data["days_of_week"] = days_of_week
schedule_data["days"] = days_of_week
if times:
schedule_data["times"] = times
schedule_data["time"] = times[0]
schedule_data["remind"] = True
resp, status = api_request("put", f"/api/routines/{routine_id}/schedule", token, schedule_data)
if status == 200: