Skip to content

fix(cron): stop promising a next run to a paused job's cut run (0.12.0 backport) - #35109

Merged
buluoray merged 1 commit into
release/0.12.0from
crew/slack/cron-paused-0120
Nov 11, 2026
Merged

buluoray merged 1 commit into
release/0.12.0from
crew/slack/cron-paused-0120

Conversation

@buluoray

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring the #34991 fix to release/0.12.0, so a gateway restart that cuts short a hand-started run of a paused cron job no longer promises a next scheduled run that never comes.

Backport of #34991 (merged to main as d48af65), picked with cherry-pick -x. The interrupted-run notice it fixes came to release/0.12.0 with #34923 (from #33905), where the GPT lane flagged this same defect.

Why it matters

0.12.x users who run a paused job by hand and then restart or update Kiro Crew get a notice that the job runs again at its next scheduled time. The scheduler skips paused jobs, so they wait for a run that does not come, and nothing corrects the message.

Not a goal

What changed (motivation → approach → change)

Same change as #34991: _alert_cron_interrupted in src/kiro_crew/slack/gateway_runtime/cron_failure.py now says "The job is paused, so it does not run again until you resume it in Schedule." for a paused recurring job. src/kiro_crew/cron_service/service/run_execution.py hands the notice the job's current stored row, so a pause or resume another process wrote during the run decides the wording. The spec in docs/system-specs/modules/learn-cron-dashboard.md matches.

The pick applied cleanly. One backport edit, in the test only: release/0.12.0 has no CronService.trigger_run, so the two new tests start the run with the file's existing _trigger_run helper, as the other tests in that file on release do.

Backwards compatibility

Compatible: only the notice text for a paused recurring job changes; enabled jobs get the same text as before.

Removes nothing: the change only picks a different sentence for one case.

Tests

  • test/test_cron_stop_interrupt_notice.py::test_a_paused_job_is_not_promised_a_next_run and ::test_a_pause_or_resume_from_another_process_is_told_right, as on main.
  • release/* PRs get no backend test lanes in CI, so I ran the related set locally in two batches, one process, no -n: 38 cron test files (the cron notice, failure alert, pause, merge, run-lifecycle and gateway-integration tests). Batch 1: 813 passed, 7 failed. Batch 2: 634 passed, 1 failed. All 8 failures (test/test_cron.py::TestFormatSchedule x7 and one test/test_cron_refactor_contract.py::test_the_schedule_math_is_unchanged case) fail the same way on a clean release/0.12.0 checkout, so they are not from this pick.
  • Mutation check on release: reverting both product files fails 3 of the 4 new cases; reverting only the run_execution.py line fails both cross-process cases. Restored: 36 passed.

Proof: not provable -- other: prove.py refused this worktree (it reported uncommitted edits while git status was clean); the manual revert check above stands in for it

Manual verification

N/A — the tests drive the real cron service and gateway notice wiring end to end.

Related Issues

Part of #34990

Sibling sweep

Swept: git grep -n "next scheduled time" -- src/ (on release/0.12.0)
Sibling: src/kiro_crew/cli_server_restart.py -- not affected -- it already skips the promise when the stored job is not enabled
Sibling: src/kiro_crew/slack/gateway_runtime/cron_failure.py -- changed here

Pattern harvest

Not generalizable: backport of #34991; the one notice that promised a next run read only the schedule kind.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

A paused recurring job can still be run by hand. When a gateway stop
cut that run short, the notice said the job runs again at its next
scheduled time, but the scheduler skips paused jobs, so that run never
came. The notice now says the job is paused and waits for a resume in
Schedule.

Closes #34990

(cherry picked from commit d48af65)

Backport note: release/0.12.0 has no CronService.trigger_run, so the
two new tests start the run through the file's own _trigger_run helper.
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 11, 2026 05:57
@buluoray
buluoray requested review from dodgeblaster and removed request for a team November 11, 2026 05:57
@buluoray
buluoray merged commit c9e7493 into release/0.12.0 Nov 11, 2026
13 of 22 checks passed
@buluoray
buluoray deleted the crew/slack/cron-paused-0120 branch November 11, 2026 06:29
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