[Authz 6/6] Add internal endpoint for schedule execution w/ Trueforge Service Key - #627
Merged
Conversation
chiragjn
requested review from
bhaveshpatel640,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
September 8, 2026 07:08
🦋 Changeset detectedLatest commit: 77fc508 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
5 tasks
chiragjn
force-pushed
the
cj-authz-schedule-execute-1
branch
from
September 8, 2026 11:06
0aafba0 to
0ff16c2
Compare
chiragjn
force-pushed
the
cj-authz-schedule-execute-1
branch
from
September 9, 2026 11:28
6022de2 to
746993a
Compare
…-schedule-execute-1
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ec7edee. Configure here.
chiragjn
commented
Sep 10, 2026
chiragjn
commented
Sep 10, 2026
added 2 commits
September 10, 2026 19:58
heerambavi1998
approved these changes
Sep 10, 2026
…foundry/trueforge into cj-authz-schedule-execute-1
…cj-authz-schedule-execute-1
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.

Note
Medium Risk
Touches scheduled execution, a new service-key-protected internal route, and TrueFoundry agent token vending for background turns—operational misconfiguration of TRUEFORGE_API_KEY could block schedules.
Overview
Scheduled runs no longer go through multi-step public SDK calls from the controller. The dispatch loop now POSTs once to
POST /api/internal/schedules/runs/executewithTRUEFORGE_API_KEY, passing onlyschedule_run_id. The server loads the run, schedule, and agent, impersonates the schedule creator viarequestContextFromCreatedBySubject, and starts the turn in-process (same path as manual run-now).TrueFoundry mode: schedule turns resolve models/MCP with agent-scoped vended tokens (saved agent + creator subject); turn skills use a dedicated
TrueFoundryAdminSkillStore(service API key). Interactive session turns still use the caller token where applicable.Adds
TRUEFORGE_API_KEY(required whenSTANDALONE=false, defaulttrueforge-standalonelocally),createApiKeyAuthMiddleware, schedule storegetRunById, OpenAPI/SDKclient.internal.schedules.executeRun, and env/docs updates for controller → server HTTP handoff.Reviewed by Cursor Bugbot for commit 77fc508. Bugbot is set up for automated code reviews on this repo. Configure here.