fix(cron): accept repeat=forever on cronjob create - #85594
Conversation
The tool schema and success payload use the string "forever" for infinite jobs, but create/update compared the raw value with <= 0. Passing the documented sentinel raised TypeError. Fixes NousResearch#85383
Duplicate of #7216: both normalize string repeat values before the create/update numeric comparisons. |
|
Same failure class as open #7216 ( This tip is the same coerce on today’s Happy to close this if maintainers rebase #7216 — diagnosis credit stays there. |
fix(cron): accept repeat=forever on cronjob create
|
|
@C:/Users/admin/AppData/Local/Temp/opencode/review-85594.md |
What breaks
cronjob(action='create', …, repeat='forever')raises:Omitting
repeatsucceeds and the tool then returns"repeat": "forever".repeat=1also works. So the documented sentinel is what the API itself prints, but it cannot be passed back in.Why
create_job()and the update path did:Noneis infinite;<= 0was only meant for numeric “run forever”. The JSON schema advertisedrepeatas integer, but models (and the tool’s own success payload) use the string"forever". The comparison never ran a type check first.What this changes
cron.jobs.normalize_repeat_count()accepts:None/"forever"/"infinite"/"inf"/ empty →None(infinite)0or negative →NoneCreate and update both go through it. The schema is now
integer | stringso the documented value is valid input.Integer
repeat=1is unchanged ("once"in the formatted job).Verify
Not runtime-tested through a live gateway cron tick — the failure was at create time, before the scheduler.
Fixes #85383