Repository navigation
fix(automations): an idle interactive run no longer blocks its cron (v0.450.1) - #847
Merged
Merged
Conversation
…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>
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.
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, reasonsuperseded— episode written, cards cancelled). Otherwise return why not.Automations.fire(guard lane = cron only) calls it; auditsautomation.superseded.automation.skippedwith the reason, once per occurrence (not once per tick across the 120-min catch-up window).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 totest:governance): supersede path + six keep-the-skip cases + once-per-occurrence skip audit. Fullnpm run test:governancegreen.🤖 Generated with Claude Code