Repository navigation
Replies: 1 comment
|
+1, and here is a concrete use case. We run a fresh-thread scheduled task that pulls each client's Search Console page-indexing report on the 3rd of every month. Indexing data needs a few days after month end to settle, so the run has to land on a fixed day of the month.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem or use case
Some recurring work runs once a month, such as a monthly report, a dependency audit, a billing review, or cleanup of old branches. A scheduled task cannot express that today.
fixed_timetakes a time of day and optional weekdays. It can run daily or weekly, but not monthly.intervaldrifts against the calendar. It counts from when the task was created or last updated, so it cannot run on "the 1st of each month at 09:00".The workaround is a daily task whose prompt says "if today is not the 1st, stop". That starts an agent turn every day, and most of those turns do nothing.
The Codex app has a monthly option for its scheduled tasks.
Proposed solution
Add an optional day-of-month list to
fixed_timeinstead of a new schedule type:monthDaysis an optional array of integers from 1 to 31. Without it, the schedule behaves as it does now.monthDaysandweekdays.31runs on April 30, so31also means "end of month".Files that would change:
packages/contracts/src/scheduledTask.tsgets the new field and the check that rejects it together withweekdays.apps/server/src/scheduledTasks/Schedule.ts,nextScheduledRunAtnow looks at most 8 days ahead. It must look up to a month ahead.isSameScheduleanddescribeSchedulemust also read the new field.schedule_taskandupdate_scheduled_taskMCP tool schemas and the orchestration instructions document the field.Schedule.test.tsandScheduledTaskService.schedule.test.tsget cases for short months, leap years, and DST changes.One question for maintainers. The scheduler skips a fixed-time run that is more than 10 minutes late. If a laptop is asleep at 09:00 on the 1st, a monthly task loses that month's run. Should a monthly run fire once when the server comes back, or keep the current skip behavior?
Why this would help
The change adds one optional field to the existing
fixed_timeschedule and covers monthly work without the daily date-check workaround and its extra agent turns.I can implement this if maintainers approve the direction and scope.
All reactions