Problem
The AsyncIOScheduler in JobScheduler.__init__ (src/scheduler/scheduler.py) is created without explicit job_defaults, which means APScheduler uses its default misfire_grace_time=1 second. This is far too strict for a bot where Claude command execution routinely takes 1-10+ minutes.
Any job that can't start within 1 second of its scheduled time is silently skipped.
Proposed Fix
Set misfire_grace_time=None and coalesce=True in job defaults:
self._scheduler = AsyncIOScheduler(
job_defaults={
"misfire_grace_time": None, # Always run, no matter how late
"coalesce": True, # Merge multiple missed runs into one
}
)
misfire_grace_time=None guarantees every job fires exactly once, regardless of how late
coalesce=True prevents duplicate execution if multiple runs were missed
This combination means the worst case is one late run, never a skipped one.
I have a working implementation with tests — happy to open a PR.
Environment
- claude-code-telegram v1.6.0
- APScheduler 3.11.x
Problem
The
AsyncIOSchedulerinJobScheduler.__init__(src/scheduler/scheduler.py) is created without explicitjob_defaults, which means APScheduler uses its defaultmisfire_grace_time=1second. This is far too strict for a bot where Claude command execution routinely takes 1-10+ minutes.Any job that can't start within 1 second of its scheduled time is silently skipped.
Proposed Fix
Set
misfire_grace_time=Noneandcoalesce=Truein job defaults:misfire_grace_time=Noneguarantees every job fires exactly once, regardless of how latecoalesce=Trueprevents duplicate execution if multiple runs were missedThis combination means the worst case is one late run, never a skipped one.
I have a working implementation with tests — happy to open a PR.
Environment