Skip to content

fix(automations): an idle interactive run no longer blocks its cron (v0.450.1) - #847

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/cron-supersede
Oct 3, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/cron-supersede

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Problem

An interactive cron automation's run keeps its TUI open after it finishes. The scheduler's pile-up guard (fire({guard:true})) treated "pane alive" as "still running", so every later occurrence was skipped until someone closed the tab — with no audit trail. The console just warned: "Interactive runs stay open — this cron won't re-fire while its last run is live."

Fix

  • TerminalManager.supersedeIdleRun(id): if the previous run is interactive, unclaimed, not mid-turn (isWorking), not blocked on a question/approval, and has no client attached, tear it down (teardownUnattended, reason superseded — episode written, cards cancelled). Otherwise return why not.
  • Automations.fire (guard lane = cron only) calls it; audits automation.superseded.
  • A skipped occurrence is now audited automation.skipped with the reason, once per occurrence (not once per tick across the 120-min catch-up window).
  • Console warning rewritten to describe the real behavior.

Conservative where it can't see: hasClient === null (launcher backend) counts as attached, so nothing changes on uid-isolated boxes.

Test

scripts/cron-supersede-test.cjs (added to test:governance): supersede path + six keep-the-skip cases + once-per-occurrence skip audit. Full npm run test:governance green.

🤖 Generated with Claude Code

…v0.450.1)

An interactive run keeps its TUI after it finishes, and the pile-up guard read
"pane alive" as "still running", silently skipping every later occurrence. The
next occurrence now closes the previous run when it is detached, unclaimed,
idle and not waiting on a person, and skips (audited once per occurrence)
only while it is genuinely in use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit 3d645ef into main Oct 3, 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