Resolve issue #921: Cron jobs missed / unclear schedules; local-TZ and active hours support#1
Conversation
- Standardize cron jobs to use device-local timezone by default - Add ActiveHours support for cron schedules (start/end HH:MM) - Update CronAddTool with improved descriptions and schema - Add comprehensive tests for scheduling logic and timezone behavior Closes tinyhumansai#921 Co-authored-by: YellowSnnowmann <167776381+YellowSnnowmann@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
ActiveHourssupport to restrict cron job execution to specific time windows (e.g., 09:00-17:00).CronAddTooldocumentation and schema to accurately describe polling behavior and timezone defaults.Problem
Cron jobs were defaulting to UTC, which was non-obvious to users expecting local time. Additionally, there was no first-class support for "active hours" (e.g., "only during work hours"), forcing users to write complex cron expressions. The product surface was also opaque about the scheduler's polling nature.
Solution
ActiveHoursstruct and updatedSchedule::Cronvariant insrc/openhuman/cron/types.rs.next_run_for_scheduleinsrc/openhuman/cron/schedule.rsto usechrono::Localas the default and implemented a skipping loop forActiveHours.CronAddToolto expose these new capabilities to the agent/user and provide "honest" product copy.Submission Checklist
src/openhuman/cron/schedule.rsand updatedops_tests.rs,scheduler_tests.rs.Impact
tzwill now be interpreted in local time instead of UTC. This is a intentional breaking change in behavior to align with the personal assistant product goal.Related
PR created automatically by Jules for task 10913585179801151017 started by @YellowSnnowmann