Scheduler: skip unreadable schedules, admit claimed runs asynchronously

A schedule that cannot be parsed or claimed is logged and skipped instead
of aborting the tick for every schedule. Claimed runs are admitted on their
own goroutines, so a slow start (worktree creation) no longer makes the
next due schedule look missed; lateness is measured at claim time. An
invalid interval no longer divides by zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 00:37:50 +00:00
parent fbc09528ec
commit ab6b2bb632
7 changed files with 198 additions and 50 deletions
@@ -120,6 +120,7 @@ func TestLegacyScheduleBindsExecutionDefaultNotOfflineOpenDirectory(t *testing.T
if err = r.scheduleTick(due, false); err != nil {
t.Fatal(err)
}
r.scheduleAdmissions.Wait()
r.wg.Wait()
runs, err := store.ListRuns(ctx)
if err != nil || len(runs) != 1 || runs[0].Workspace != resolvedB || !runs[0].Scheduled || runs[0].ScheduleID != original.ID {