fix(cron): bound schedules and due batches - #332
Merged
Conversation
Contributor
Author
|
@tt-a1i 麻烦有空帮忙 review 一下,谢谢。 |
tt-a1i
approved these changes
Sep 2, 2026
tt-a1i
left a comment
Collaborator
There was a problem hiding this comment.
Verified exact head 2b22a2f. The duration and absolute-time checks, fixed Session/job delivery bounds, pending retention, and successful-delivery-only advancement preserve the Cron lifecycle while closing the correctness and resource-boundary gaps. Focused tests, repository checks, full tests, and current CI are green.
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
Closes #323.
/cronvalidated the numeric duration before unit conversion, so a finite input could overflow toInfinityin milliseconds and be reported as scheduled even though it could never become due. The Session job list and the aggregated due-job follow-up also had no total count or UTF-8 byte bounds.Value
Cron scheduling now fails explicitly for unrepresentable times and keeps both Session memory and model-visible due delivery within fixed limits. Valid pending work is retained instead of being silently lost when one delivery batch reaches its budget.
Approach
The limits are fixed runtime invariants rather than new user configuration. Batch selection preserves existing job order.
Validation
bun run check— passed: config contract, discipline ledger, formatting, lint, and typecheck.bun run test— passed: 1113 tests, 0 failed, 1 skipped; the additional Vitest suite passed 30 tests.git diff --check— passed./reload, withpi listshowing only the local checkout:/cron in 30s 回复:cron one-shot 已触发scheduled and fired successfully./cron in 9007199254741s 不应创建was rejected with an explicit duration warning.Impact
inandeveryschedules are unchanged. Only previously unbounded or unrepresentable inputs are rejected or split.