Skip to content

[Feature]: Active time window for interval scheduled tasks #26116

Closed

Description

@rwspatin

Problem

Recurring scheduled tasks can only be interval (every N ms, around the clock) or fixed_time (one wall-clock time, optional weekdays). There is no way to say "run every hour, but only between 08:00 and 19:00".

My real use case: a recurring task that should run during working hours only, e.g. every 30–60 min from 08:00 to 19:00 on weekdays. Today the options are:

  1. One fixed_time task per slot: 12 tasks for hourly 08–19, 24 for every 30 min. Works, but it's a pain to create, edit, pause, or change the prompt for all of them at once.
  2. interval plus a guard in the prompt ("if local time is outside 08:00–19:00, reply 'skipped' and stop"): one task, but every off-hours tick still starts an agent turn and spends usage/tokens just to decide not to work. It also fills the thread with no-op turns.

Proposal

Add an optional active window to interval schedules:

{
  "type": "interval",
  "everyMs": 1800000,
  "activeWindow": {
    "start": "08:00",          // local wall-clock, inclusive
    "end": "19:00",            // local wall-clock, exclusive; end < start could mean an overnight window
    "weekdays": [1, 2, 3, 4, 5] // optional, same convention as fixed_time (0 = Sunday)
  }
}

Behavior:

  • Ticks that fall outside the window are skipped by the scheduler, so no turn starts and no usage is spent.
  • nextRunAt jumps to the next in-window slot (e.g. Friday 19:00 → Monday 08:00).
  • Ideally the first run of each window fires at start (08:00) rather than "whenever the interval happens to land", i.e. intervals align to the window start.
  • Uses the same local time zone as fixed_time (related: scheduler: scheduled task times shown in UTC instead of local/system time (IST) #18632).

UI: in the schedule editor, add a "Only between [08:00] and [19:00] on [weekdays]" row under the interval picker. MCP: expose the same field on schedule_task / update_scheduled_task.

Alternatives considered

  • Allowing multiple timeOfDay values on fixed_time (["08:00","09:00",...]) would also help, but an interval plus window is easier to express and edit.
  • Full cron syntax (*/30 8-18 * * 1-5) covers this too, but is less friendly in the UI. It could be an advanced option.

Thanks!

Activity

  1. locked and limited conversation to collaborators on Oct 27, 2026
  2. converted this issue into a discussion #26121 on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions