Repository navigation
feat(scheduler): add github scheduling backend - #1056
Merged
Merged
Conversation
Schedules materialize as GitHub Actions scheduled workflows in a configurable repository (default <login>/.routines, auto-created private). Saves push directly to the default branch, or open a PR when scheduler.github.pull_requests is enabled. Workflows run the job prompt via inference-gateway/infer-action under the infer GitHub App bot identity (APP_CLIENT_ID / APP_PRIVATE_KEY secrets) and upload the run's conversation jsonl as an artifact; the daemon polls artifacts (default 10m, 3 attempts per artifact, 1h rate-limit backoff, all configurable) into local conversation storage. Cron descriptors are translated to GitHub's 5-field UTC syntax or rejected at save time; run_once jobs disable their own workflow after the first fire. Closes #1055
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
edenreich
commented
Aug 12, 2026
Co-authored-by: Eden Reich <[email protected]>
Contributor
|
🎉 This PR is included in version 0.168.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
3 tasks
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 a
githubscheduling backend (closes #1055): schedules materialize as GitHub Actions scheduled workflows in a repository the user configures — cloud scheduling with zero user-owned infrastructure.How it works
internal/services/githubscheduler.Store): wraps the localScheduledJobStorage; reads stay local, writes render the job's workflow (.github/workflows/<job-id>.yml) and deploy it — pushed straight to the default branch by default, or via a branch + PR whenpull_requests: true. A failed GitHub sync aborts the local save (no phantom jobs).gh repo create <owner>/.routines --private --add-readmeon first save when missing. All GitHub access goes through theghCLI (reusing thegithubsetuprunner seam).actions/create-github-app-token(APP_CLIENT_ID/APP_PRIVATE_KEYsecrets, same convention as opentask) and runsinference-gateway/infer-actionwithgithub-token+github-app-slugfrom the step outputs, using the job's prompt asdirect-prompt.@daily→0 0 * * *,@every 10m→*/10 * * * *, …); inexpressible ones (@every 7m,* * * * *, sub-5-minute steps) are rejected at save time with a clear error.~/.infer/conversations/*.jsonlas aninfer-conversations-<run_id>artifact; a daemon-hosted poller (mirrors the heartbeat service) downloads new artifacts into local conversation storage — configurable interval (10m), max 3 attempts per artifact, 1h backoff after a rate-limited API call (rate-limited attempts don't consume attempts). Jsonl storage backend only.backend: githubthe local cron scheduler is skipped; the artifact poller starts instead.pull_requests: true) and notes that GitHub schedules fire in UTC.Out of scope (per issue)
Channel delivery of GitHub-backed job output, syncing runs into
RunRecords, other cloud backends.Testing
cron_test.go: full translation matrix (descriptors,@every, rejections).workflow_test.go: YAML round-trip with multiline/colon prompts, pins, app-token/upload/self-disable steps.store_test.go: scripted fake runner — exact gh/git sequences for direct-push vs PR mode, repo auto-create, default-repo resolution, cron rejected before any subprocess, gh failure leaves local store unchanged.artifacts_test.go: zip extraction + idempotence, state persistence across restarts, retry-then-give-up, rate-limit backoff semantics.task precommit:rungreen; fullgo test ./...green.Docs
docs/scheduling.md: new GitHub backend section (setup, secrets, save-to-deploy flow, artifact pull-back).docs/configuration-reference.md:INFER_SCHEDULER_*env vars.