Skip to content

fix(cron): preserve in-flight pause after recurring job completion - #1022

Draft
yunyv wants to merge 2 commits into
modelscope:mainfrom
yunyv:fix/cron-pause-completion
Draft

yunyv wants to merge 2 commits into
modelscope:mainfrom
yunyv:fix/cron-pause-completion

Conversation

@yunyv

@yunyv yunyv commented Oct 24, 2026

Copy link
Copy Markdown

Change Summary

Pausing a running recurring cron job currently succeeds, but recording its result changes it back to scheduled. The next tick can then execute the job again without a resume request.

Preserve an already-persisted paused status when recording a recurring job result that has another scheduled run. Continue recording history, counters, errors and repeat progress, and advancing the next-run time. One-shot jobs and exhausted repeats still complete.

Tests cover interval and cron schedules, successful and failed executions, persisted reload, no dispatch while paused, and execution after resume. This does not cancel the current execution or change concurrent-process updates or manual force-run behavior.

Validation:

  • Untouched baseline with the new regressions: 5 failed, 4 passed.
  • Fixed cron suite using normal SDK imports: 107 passed.
  • Configured changed-file pre-commit checks and git diff --check: passed.
  • pre-commit install and pre-commit run --all-files were run on the pause checkout and an untouched baseline. Both full-repository runs failed with identical output after normalizing checkout paths: existing flake8, isort, YAPF, trailing-whitespace and quote-formatting issues. Examples include .dev_scripts/webui/oss_distribution.py:140 and ms_agent/config/skills_manager.py:61. Unrelated automatic edits were restored; both changed files retain their tested hashes.
  • Independent validation reproduced the baseline failures and confirmed the fixed suite. A separate throwaway compatibility check with the polling/rearm change passed all 120 cron tests; that change is not included here.

Prepared and tested with AI assistance. No live model/provider calls were used.

Related issue number

None. No competing pause fix was found in the all-state issue/PR search on 2026-10-24. This change is separate from interval UTC normalization in #1013.

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Run pre-commit install and pre-commit run --all-files before git commit, and passed lint check. Hooks were installed and full-repository checks ran; the identical baseline failures described above remain. Changed-file checks passed.
  • Documentation reflects the changes where applicable (no new command or configuration)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant