Skip to content

[DEV-81] Add recurring scheduled automations to the devintern worker - #36

Merged
danii1 merged 5 commits into
mainfrom
feature/dev-81
Aug 24, 2026
Merged

[DEV-81] Add recurring scheduled automations to the devintern worker#36
danii1 merged 5 commits into
mainfrom
feature/dev-81

Conversation

@danii1

@danii1 danii1 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Task: DEV-81

Summary: Add recurring scheduled automations to the devintern worker

Implementation Details

Implemented DEV-81 end to end.

Key additions:

  • Validated [[automations]] configuration for workspace and single-repo mode.
  • Five-field cron scheduling via cron-parser and 15m/6h/1d intervals.
  • Persistent SQLite schedule cursors, leases, heartbeats, overlap prevention, stale recovery, and missed-run coalescing.
  • Automation-only workers without tracker polling or webhook listening.
  • Subprocess-isolated headless and create_ticket execution.
  • Workspace environment layering, managed worktrees, and per-repository locking.
  • PM engine reuse for ticket generation and creation.
  • scheduled run origin, automation_id, and created-ticket metadata migrations.
  • Dashboard filtering, statistics, labels, and ticket links for scheduled runs.
  • Graceful automation subprocess shutdown.
  • Updated worker, workspace, dashboard documentation and configuration examples.
  • PM prompt assets included in production builds.

Verification completed:

  • Code suite: 760 tests passed.
  • New focused suite: 34 tests passed, including both action types.
  • Dashboard suite: 35 tests passed.
  • Code and dashboard typechecks passed.
  • Lint passed with existing warnings only.
  • Production code and dashboard builds passed.
  • git diff --check passed.

This PR was automatically created by @devintern/code

devintern-internal[bot] and others added 5 commits August 21, 2026 22:23
- cap long scheduler timers and serialize ticks with lifecycle-aware shutdown cleanup
- send automation invocation payloads over stdin instead of command-line arguments
- validate default projects against the selected tracker
- acquire repository run locks before clone, fetch, and worktree preparation
- add regression coverage for long schedules, shutdown cleanup, large prompts, tracker defaults, and busy repositories

Iteration 2: address additional review feedback

Iteration 3: address additional review feedback

Iteration 4: address additional review feedback

Iteration 5: address additional review feedback
Treat each automation occurrence's prompt as the task itself instead of
maintaining separate headless/create_ticket execution paths:

- materialize the prompt as a local markdown task file and spawn the
  normal CLI pipeline (plan -> implement -> --create-pr -> review),
  reusing workerTaskArgs so automations behave like polled tasks
- attribute scheduled runs via DEVINTERN_RUN_ORIGIN/DEVINTERN_AUTOMATION_ID
  env markers read by beginRun, keeping dashboard filtering intact
- drop the action field, tracker_project, scheduled-executor.ts, the
  __automation-run internal command, and the PM engine dependency;
  automations are now fully independent of any task tracker
Write occurrence task files into the nearest .devintern-code found by
walking up from the run cwd (same resolution as queue.db), so a worker
launched from a subfolder reuses the project config directory instead
of creating a stray nested one. Falls back to <cwd>/.devintern-code for
disposable worktrees with no parent config.
…ace home

- worker.md: occurrence walkthrough (task file location, manual rerun),
  prompt-writing guidance, WORKER_TASK_ARGS tuning, troubleshooting table
- workspaces.md: dedicated subsection on how fleet automations execute;
  fix task-file location claim
- dashboard.md: scheduled runs show PR links now that create_ticket is gone

Code: add AutomationRunContext.taskFileDir so workspace automations write
occurrence markdown tasks under <workspace-home>/automations/<id>/ instead
of inside repo worktrees, where config-dir traversal would stop at .git
@danii1
danii1 merged commit b5bd7c3 into main Aug 24, 2026
1 check 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