Skip to content

Resolve issue #921: Cron jobs missed / unclear schedules; local-TZ and active hours support#1

Closed
YellowSnnowmann wants to merge 2 commits into
mainfrom
issue-921-cron-improvements-10913585179801151017
Closed

Resolve issue #921: Cron jobs missed / unclear schedules; local-TZ and active hours support#1
YellowSnnowmann wants to merge 2 commits into
mainfrom
issue-921-cron-improvements-10913585179801151017

Conversation

@YellowSnnowmann

@YellowSnnowmann YellowSnnowmann commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Standardized cron jobs to use device-local timezone by default when no timezone is specified.
  • Introduced ActiveHours support to restrict cron job execution to specific time windows (e.g., 09:00-17:00).
  • Enhanced CronAddTool documentation and schema to accurately describe polling behavior and timezone defaults.
  • Updated core scheduling logic to correctly handle midnight-spanning active hour windows.

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

  • Added ActiveHours struct and updated Schedule::Cron variant in src/openhuman/cron/types.rs.
  • Updated next_run_for_schedule in src/openhuman/cron/schedule.rs to use chrono::Local as the default and implemented a skipping loop for ActiveHours.
  • Updated CronAddTool to expose these new capabilities to the agent/user and provide "honest" product copy.
  • Added comprehensive unit tests for local timezone defaults and active hours (including midnight crossing).

Submission Checklist

  • Unit tests — Added tests in src/openhuman/cron/schedule.rs and updated ops_tests.rs, scheduler_tests.rs.
  • E2E / integration — (Existing unit tests cover the logic thoroughly; no UI changes yet).
  • Doc comments — Updated tool descriptions.
  • Inline comments — Added comments explaining local TZ standardization and midnight-spanning windows.

Impact

  • Migration: Existing jobs without a tz will 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.
  • Performance: Negligible impact; the safety loop for active hours is efficient.

Related


PR created automatically by Jules for task 10913585179801151017 started by @YellowSnnowmann

- 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>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@YellowSnnowmann YellowSnnowmann marked this pull request as ready for review April 27, 2026 10:26
YellowSnnowmann added a commit that referenced this pull request Jun 8, 2026
- Fix back button text: "Back" → "Go back" (matches i18n key)
- Add table readiness wait in navigateToMcpTab
- Replace waitForTimeout with data-driven waits
- Registry mock now excludes installed servers (CodeRabbit #1)
- Fix route-ordering comment (CodeRabbit #2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant