Skip to content

refactor: remove shouldRun alias and add error isolation in ScheduleManager#115

Merged
avoidwork merged 2 commits into
mainfrom
docs/fix-scheduler-clockTick
Jun 6, 2026
Merged

refactor: remove shouldRun alias and add error isolation in ScheduleManager#115
avoidwork merged 2 commits into
mainfrom
docs/fix-scheduler-clockTick

Conversation

@avoidwork
Copy link
Copy Markdown
Owner

Description

Remove redundant `shouldRun()` alias, clean up unused `_scheduler` parameter from `#clockTick`, and add try/catch error isolation around single-entry clockTick checks. Also updates docs/FLOWS.md to use `matchesCron` consistently.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature which would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional change)
  • Performance improvement
  • CI / build / tooling

Testing

All 961 tests pass. Four new test cases added:

  • `#clockTick continues checking other entries if one throws` — verifies try/catch isolation keeps other entries running
  • `#clockTick does not throw even with corrupted entries` — verifies no unhandled exceptions from bad data
  • `#clockTick with 2 valid + 1 paused — all skip correctly` — verifies paused check still works alongside try/catch
  • `#clockTick with 3 matching entries — only 1 deduped` — verifies try/catch does not break deduplication

Coverage

  • 100% line coverage maintained

Checklist

  • `npm run lint` passes
  • Tests pass with 100% line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

@avoidwork avoidwork self-assigned this Jun 6, 2026
The cron tool's runJob function passed {} as the sandbox argument to
runScheduledSkill, which expects a callable function. This commit:

1. Add findSkillScript() to locate skill scripts in skill directories
2. Add runScript() to execute scripts via spawn (not fork)
3. Modify runJob() to use runScript when no scheduler module is available
4. Maintain backward compat with existing schedulerModule path
5. Add 7 new tests across findSkillScript, runScript, and cronjob

This allows scheduled cron jobs to execute properly without needing full
scheduler/agent context at runtime.
@avoidwork avoidwork force-pushed the docs/fix-scheduler-clockTick branch from a10373d to 38971f5 Compare June 6, 2026 17:42
@avoidwork avoidwork merged commit 835fa13 into main Jun 6, 2026
2 checks passed
@avoidwork avoidwork deleted the docs/fix-scheduler-clockTick branch June 6, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant