feat: Entrypoint for schedule controller - #542
Merged
Merged
Conversation
thesujai
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998 and
sr07asthana
as code owners
September 2, 2026 05:16
🦋 Changeset detectedLatest commit: 00c57ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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 63b9a5f. Configure here.
thesujai
commented
Sep 2, 2026
sr07asthana
reviewed
Sep 2, 2026
sr07asthana
reviewed
Sep 2, 2026
sr07asthana
reviewed
Sep 2, 2026
chiragjn
reviewed
Sep 2, 2026
chiragjn
reviewed
Sep 2, 2026
chiragjn
approved these changes
Sep 2, 2026
chiragjn
left a comment
Member
There was a problem hiding this comment.
Approved with minor comments
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
Entrypoint for schedule controller
Closes #
Changes
Entrypoint for schedule controller
How was this tested?
Checklist
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
Split deployments depend on exactly one controller per database and correct
SERVER_URL; misconfiguration could duplicate dispatch or leave schedules idle, and Helm value renames (replicaCount→server.replicaCount) are a breaking chart upgrade.Overview
Adds
dist/controller-main.jsso schedule dispatch and other periodic control loops can run as a single-replica process in distributed mode (STANDALONE=false), calling the server API over HTTP via newSERVER_URL(defaulthttp://localhost:$PORT). Standalone still runs the controller in the server process; the dedicated entry exits cleanly whenSTANDALONE=true.Build & dev:
tsupemitscontroller-main; package scripts addstart:controllerand paralleldev:controllerfor local split-process dev. Logs gain acomponentfield (server|controller) in JSON mode.Deployments: Docker Compose, Railway IaC, and the Helm chart each gain a second controller workload (fixed 1 replica, Recreate / zero overlap on Railway) with
SERVER_URLpointed at the server service. Helm moves server scaling knobs underserver.replicaCount/server.strategyand documents the controller Deployment (no Service, distinct selector labels so traffic never hits controller pods).Reviewed by Cursor Bugbot for commit 00c57ce. Bugbot is set up for automated code reviews on this repo. Configure here.