-
Notifications
You must be signed in to change notification settings - Fork 79
fix: narrow exhaustion catch to no-future-run errors, use future date in test #6278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,7 +216,12 @@ export function claimDueSchedules(now: number): ScheduleJob[] { | |
| expression: row.cronExpression, | ||
| timezone: row.timezone, | ||
| }); | ||
| } catch { | ||
| } catch (err) { | ||
| // Only treat "no upcoming runs" as exhaustion — rethrow other failures | ||
| // (e.g. invalid RRULE lines, unsupported syntax) so they surface instead | ||
| // of silently disabling a schedule that has a configuration bug. | ||
| const msg = err instanceof Error ? err.message : String(err); | ||
| if (!msg.includes('no upcoming runs')) throw err; | ||
|
Comment on lines
+219
to
+224
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Rethrowing non-exhaustion errors from claimDueSchedules blocks all other schedules, reminders, and watchers When Root Cause and ImpactIn Previously, the bare For example, if a schedule somehow has an invalid RRULE stored in the DB (e.g., missing DTSTART due to a migration bug), Expected behavior: A single bad schedule should not prevent other valid schedules (and reminders/watchers) from being processed. The error should be logged and the bad schedule skipped (or disabled with an error status), while the loop continues. Actual behavior: The rethrown error aborts the entire Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| // Finite schedule with no future runs — still claim the current due | ||
| // run but disable the schedule so it doesn't fire again. | ||
| newNextRunAt = null; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test setup now contradicts the exhaustion path it is trying to verify:
claimDueSchedulesrecomputes next run from the RRULE expression (assistant/src/schedule/schedule-store.ts,computeNextRunAtEnginecall) andcomputeNextRunAtuses current wall time by default (assistant/src/schedule/recurrence-engine.ts), so aDTSTART5 years in the future still has an upcoming run and will not hit the'no upcoming runs'catch branch. Forcingnext_run_atto the past in SQL does not change RRULE evaluation, so the schedule remains enabled and this assertion will fail once tests run.Useful? React with 👍 / 👎.