fix(web,database): automations never auto-pause; a failed start just records its failure

Merged
DA
5d ago
+25-139

PR 0 of the approved automations plan (docs/proposals/automations-scope.md ยง4, round 3).

Dean: "Let's not have complexity to auto-pause any automations (like after 3 failed runs or anything), this is overengineering."

What changes

  • The three-failed-starts pause is removed (pauseAfterFailures, FAILURES_TO_PAUSE), and so are the store reads only it used (latestAutomationStarts, pauseAutomation).
  • A failed start now records its failure in one fixed word (AUTOMATION_RUN_REASON), and the next firing tries again.
  • A departed creator's automation simply fails each run, with the reason shown. Owners and admins delete it.

What stays, until the contract step

  • The paused_reason column and the failures wire value stay, so a row an older build paused still reads, and a resume (PATCH {enabled: true}) still clears it.
  • The README's Automations section says so.

Tests

  • automation-runs.test.ts: the two pause tests and "missed runs never count toward a pause" are replaced. The new test runs four failing starts in a row: each records no-repository, and the automation stays on, with no pause reason. It fails on the old code.
  • automations-app.test.ts: the resume test now sets up "a row an older build paused" with a direct update, since nothing pauses rows any more.

No Mac UI. pnpm check:affected exits 0.

๐Ÿค– Generated with Claude Code


Open workspace in Conductor


Devin Review


Summary by cubic

Removes the three-failed-starts auto-pause so automations never pause for failing; a failed start now records its failure in one fixed word and the next firing tries again.

  • Deletes pauseAfterFailures, FAILURES_TO_PAUSE, and the store reads only the pause used (latestAutomationStarts, pauseAutomation).
  • Keeps the paused_reason column and failures wire value so rows an older build paused still read, and a resume (PATCH {enabled: true}) still clears them.
  • The pause tests now assert four failing starts in a row leave the automation on with no pause reason.