Repository navigation
feat: Schedules - #472
Merged
Merged
feat: Schedules#472
Conversation
🦋 Changeset detectedLatest commit: dc2b4bf The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
heerambavi1998
force-pushed
the
ha/schedules
branch
from
August 27, 2026 10:26
663212d to
3e97b6f
Compare
heerambavi1998
force-pushed
the
ha/schedules
branch
from
August 27, 2026 11:10
793856b to
1e663eb
Compare
added 4 commits
August 27, 2026 19:08
also remove pause/resume methods - move status to manifest
heerambavi1998
force-pushed
the
ha/schedules
branch
2 times, most recently
from
August 27, 2026 18:59
471fa8e to
6fdbf57
Compare
heerambavi1998
force-pushed
the
ha/schedules
branch
from
August 27, 2026 19:02
b1016f2 to
2cc0833
Compare
heerambavi1998
force-pushed
the
ha/schedules
branch
from
August 27, 2026 19:15
7a56403 to
86c451b
Compare
heerambavi1998
requested review from
bhaveshpatel640,
chiragjn,
sr07asthana and
thesujai
as code owners
August 27, 2026 20:06
heerambavi1998
force-pushed
the
ha/schedules
branch
from
August 28, 2026 06:42
d8ab5c4 to
510398b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 816f3fc. Configure here.
debajyoti-truefoundry
approved these changes
Aug 28, 2026
added 4 commits
August 28, 2026 12:51
heerambavi1998
enabled auto-merge (squash)
August 28, 2026 07:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds first-class cron schedules for existing agents: persist them, manage them via
/api/v1/schedules, validate cron policy at write time, and advance due runs through a single-dispatcher claim path.What's included
schedule+schedule_run, with:schedule_run_pending_uq)sched:<unixSeconds>)scheduledrowsIScheduleStorewith SQLite/Postgres implementation/api/v1/schedules{ task, cron, timezone }— 5-field cron in an IANA zonedispatchDueRuns— re-read schedule in-txn, mark late runsmissed, arm next slot, hand off triggered runs after the pass commits; single-dispatcher assumption (no row claim)Design notes
manifest(same pattern as agents/skills).schedule.created_by;triggered_byis that userRef.SCHEDULE_MAX_LATENESS_SECONDS, 1h): overdue slots are recordedmissedand the series advances rather than firing a stale backlog.How was this tested?
validateManifestChecklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Medium Risk
New background dispatch and transactional schedule/run state interact with API updates (409 races); triggered runs do not execute agents yet, so behavior is incomplete until an executor lands.
Overview
Introduces first-class cron schedules that bind to existing agents by name, send a fixed task message on each run, and are managed through new authenticated
/api/v1/schedulesCRUD endpoints (optionalagent_namefilter on list). Manifests carry 5-field cron, IANA timezone (default UTC), and active/paused status; writes runvalidateManifest(valid next fire, minimum 1 hour between triggers) and mapInvalidCronErrorto 400. Create/update run in transactions that sync a single pendingschedule_runwhen status/cron/timezone change; conflicts surface as 409 for retry.Persistence adds
scheduleandschedule_runtables (Postgres + SQLite migrations) with agent FK cascade, one pending run per schedule, and dispatch-friendly indexes.IScheduleStoreis wired into the server and OpenAPI/docs; the Ferntrueforge-sdkgains aclient.schedulesresource.A
Controllerruns a ~60s schedule-dispatch loop: in standalone it lives in the server process; in distributed mode a dedicatedsrc/controller.tsentry point owns it (single replica). Due runs are handed toonTriggered(currentlylogTriggeredRunonly—runs are marked triggered/failed and the next slot is armed; real agent execution is still TODO).Reviewed by Cursor Bugbot for commit dc2b4bf. Bugbot is set up for automated code reviews on this repo. Configure here.