Skip to content

feat: API to trigger a manual run - #538

Merged
sr07asthana merged 16 commits into
mainfrom
sr-AGE-1977
Sep 1, 2026
Merged

sr07asthana merged 16 commits into
mainfrom
sr-AGE-1977

Conversation

@sr07asthana

@sr07asthana sr07asthana commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
New endpoint starts real agent turns in-process and shares turn-execution paths with sessions; failures and RBAC are handled but behavior affects scheduling and agent execution.

Overview
Adds POST /api/v1/schedules/runs so callers can start a schedule immediately with { schedule_id }, using the task from the schedule manifest. The run is recorded with a manual-* name and triggered status; the existing cron pending run is left unchanged.

The handler enforces the same creator-scoped access as other schedule APIs, persists the run, then kicks off work in-process via shared startScheduleRun (session get-or-create by run id, idempotent turn when the session has no turns). Turn startup is factored into beginTurnExecution, startTurnInProcess, and getTurnExecutionError so the HTTP turns API and run-now path share one engine; failed starts mark the run failed and map errors to 400/404/422 as appropriate.

OpenAPI, Fern-generated SDK schedules.createRun, and unit/wire tests cover the new surface.

Reviewed by Cursor Bugbot for commit ebb53c6. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ebb53c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge Patch

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

Comment thread .github/fern/openapi/openapi.json Resolved
Comment thread packages/trueforge/src/apis/turns.ts Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e5bcf47. Configure here.

@sr07asthana
sr07asthana merged commit 8e64757 into main Sep 1, 2026
10 checks passed
@sr07asthana
sr07asthana deleted the sr-AGE-1977 branch September 1, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants