Skip to content

fix(cron): normalize interval run times to UTC - #1013

Open
Achordchan wants to merge 1 commit into
modelscope:mainfrom
Achordchan:fix/interval-utc-normalization
Open

Achordchan wants to merge 1 commit into
modelscope:mainfrom
Achordchan:fix/interval-utc-normalization

Conversation

@Achordchan

Copy link
Copy Markdown

Change Summary

Interval schedules currently format non-UTC clock times with a literal +00:00 suffix. For example, advancing 2099-01-01T09:00:00+08:00 by one hour produces 10:00+00:00 instead of 02:00+00:00, shifting the next run by eight hours. This also affects persisted offset-bearing next_run_at values advanced by JobManager.record_result().

Convert interval results to UTC before formatting in both scheduling paths. Preserve the existing interpretation of naive interval base times as UTC. No new configuration or dependencies.

Tests cover positive/negative offsets, UTC, naive inputs and overdue fast-forwarding. The original implementation fails the offset regression cases. A temporary-directory check through JobManager and the JSON repository confirms the correct next run is persisted and reloaded.

Validation: python -m pytest tests/cron -q (106 passed), changed-file pre-commit checks, and git diff --check. Full-repository pre-commit was also attempted; it reports existing lint/style failures, including .dev_scripts/webui/oss_distribution.py:140 and ms_agent/config/skills_manager.py:61. Unrelated automatic formatting was excluded from this patch.

Prepared and tested with Codex assistance.

Related issue number

None; found while checking timezone handling in the cron parser and scheduler. This does not overlap #997's one-shot timestamp validation.

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. Both ran; baseline failures are described above.
  • 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant