Repository navigation
fix(cron): stop promising a next run to a paused job's cut run (0.12.0 backport) - #35109
Merged
Merged
Conversation
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.
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 / 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_interruptedinsrc/kiro_crew/slack/gateway_runtime/cron_failure.pynow 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.pyhands the notice the job's current stored row, so a pause or resume another process wrote during the run decides the wording. The spec indocs/system-specs/modules/learn-cron-dashboard.mdmatches.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_runhelper, 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_runand::test_a_pause_or_resume_from_another_process_is_told_right, as on main.-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::TestFormatSchedulex7 and onetest/test_cron_refactor_contract.py::test_the_schedule_math_is_unchangedcase) fail the same way on a clean release/0.12.0 checkout, so they are not from this pick.run_execution.pyline 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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.