Skip to content

feat(pipeline): scheduled runs — once or on a cron, from Home - #226

Merged
hoangsnowy merged 1 commit into
mainfrom
feat/scheduled-runs
Oct 19, 2026
Merged

hoangsnowy merged 1 commit into
mainfrom
feat/scheduled-runs

Conversation

@hoangsnowy

Copy link
Copy Markdown
Owner

Summary

Parity item 3. Home → Schedule… (admin): once / daily / weekdays / weekly / custom cron — UTC, ≥ 15-min cadence. Scheduled panel with Pause / Resume / Delete.

  • pipeline.scheduled_runs + migration, tenant filter + RLS; in-memory fallback.
  • ScheduledRunWorker: atomic per-occurrence claim (no double runs across Api + Web / replicas), runs via IOrchestratorAgent under the owner's identity → budget gate, run admission, persistence, metrics unchanged. Skips recorded; no catch-up storm; one-offs finish.
  • Audited changes, 20 per tenant. Cronos 0.13.0. Btn attribute passthrough.

Test plan

  • Unit 1256 / 0 failed — ScheduledRunsTests (cadence guard, presets, isolation, cap, pause/resume, single claim, missed-occurrence, budget/limit skips) + RLS table guard.
  • Standalone E2E 29/29 — new ScheduledRunsTests (refuse every-minute, create weekdays, pause, delete).
  • Full stack: one-off fired at the scheduled minute → one pipeline run (Api + Web both running the worker), schedule disabled, LastStatus Done; RLS enabled+forced with agentos_tenant policy; create/delete audited; test rows removed (no residue).

🤖 Generated with Claude Code

https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB

Competitor parity item 3 (docs/plans/competitive-parity.md). Admins can schedule a story from
Home (Schedule…): once, every day, weekdays, every week, or a custom 5-field cron — UTC,
labelled as such, at most every 15 minutes (each run spends real tokens). A Scheduled panel
lists them with next/last run and Pause / Resume / Delete.

- pipeline.scheduled_runs (EF migration; tenant query filter + Postgres RLS, added to
  RowLevelSecurity.Tables); in-memory store for the stateless standalone Web.
- ScheduledRunWorker (30 s tick) claims due occurrences atomically (optimistic single-row
  UPDATE), so the Api and the Web — or several replicas — never double-run; it runs each
  through IOrchestratorAgent under the owner's identity, i.e. the same path as POST /pipeline
  (budget gate, run admission, persistence, metrics). Budget / run-limit refusals are recorded
  as skipped; missed occurrences run once (no catch-up storm); a fired one-off disables itself.
- Every create / pause / resume / delete is audited (Activity log), max 20 per tenant.
- Cronos 0.13.0 (latest) for cron parsing.
- Btn passes extra attributes through (aria-label, data-*); the no-key message points at
  Settings → AI → Model keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
@hoangsnowy
hoangsnowy merged commit e24d7c9 into main Oct 19, 2026
4 checks passed
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.

1 participant