Repository navigation
Keep /schedule resume paused-only so completed one-shots stay terminal - #334
Merged
Merged
Conversation
A successful one-shot leaves next_fire_at in the past. Resume used to set status=active and next=now+1 for any non-running row, so an agent could re-queue finished work. Gate pause/resume on status so terminal rows cannot take the pause-then-resume path either. Operators still PATCH failed one-shots to active. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
This was referenced Sep 13, 2026
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_121a8835-ba96-4e52-a8e7-5764a956a88e) |
tylerreckart
enabled auto-merge (squash)
September 21, 2026 13:29
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
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
/schedule resume <id>flipped any non-running row toactive. After a successful one-shot fire,next_fire_atis still the original due time (in the past). Resume then setnext=now+1, solist_duere-queued finished work on the next tick./schedule pauseon acompleted/failedrow plus resume was the same bypass.This is distinct from recovery (#278): that path releases a crashed
runninglease back toactive. HTTPPATCHtoactiveremains the documented operator retry for failed one-shots.Fix
schedule_pause_block_reason/schedule_resume_block_reasonencode the writ policy:pausedactive/running/pausedcompleted,failed, andcanceledstay terminalThe scheduler invoker returns
ERR:before mutating. Recurring resume still recomputesnext_fire_atwhen the previous fire is in the past.Tests
unit_schedule_parser— allowed pause/resume statuses vs terminal and unknown statuses.Independently mergeable against
main. Code hunks (schedule_parser, invoker ~5711) auto-merge with #321–#333. CHANGELOG[Unreleased]will need a rebase after whichever sibling merges first.Note
Medium Risk
Changes writ behavior for schedule lifecycle (agents/operators using pause/resume on terminal tasks will see ERR instead of silent re-queue); logic is localized with tests but affects background job firing.
Overview
/schedule pauseand/schedule resumeare now status-gated so finished one-shots cannot be accidentally re-queued.Previously,
/schedule resumecould set almost any non-runningrow back toactive. For a completed one-shot,next_fire_atstays in the past after a successful fire; resume then bumpednexttonow+1, so the scheduler picked it up again on the next tick. Pause-then-resume on terminal rows was the same bypass.The fix adds
schedule_pause_block_reason/schedule_resume_block_reasonand has the scheduler invoker returnERR:before PATCH when the transition is invalid: resume only frompaused; pause only fromactive,running, orpaused;completed/failed/canceledstay terminal. Recurring resume still recomputesnext_fire_atwhen the prior fire is overdue. Docs and CHANGELOG describe recreating finished one-shots; HTTP PATCH toactiveremains the operator retry path for failed one-shots.Unit tests cover allowed vs blocked statuses for both writs.
Reviewed by Cursor Bugbot for commit a2892b9. Bugbot is set up for automated code reviews on this repo. Configure here.