15 launchd Jobs and One Quota Circuit Breaker: Deciding What to Re-run Once the Circuit Closes
Описание и применение
Скрипт quota‑catchup.py автоматически запускает пропущенные launchd‑задачи после восстановления квоты, предотвращая пропуск ежедневных запусков.
Задача
When a quota circuit breaker halts launchd jobs, the skipped jobs never automatically resume after the circuit closes, causing missed executions.
Результат
All previously skipped jobs are re‑executed promptly after quota recovery, preventing missed daily runs and ensuring consistent job completion.
Рабочий процесс
- 1. Run claude-quota-guard.py to monitor quota and skip jobs when necessary.
- 2. When quota recovers, launchd resumes normal scheduling but skipped jobs stay idle until next slot.
- 3. Execute quota-catchup.py to scan all launch agent plists.
- 4. For each plist, check if it is guarded, if today’s latest marker is SKIPPED, and if any StartCalendarInterval slot has passed today.
- 5. Collect candidates that satisfy all three conditions.
- 6. Re‑run each candidate job immediately (e.g., via launchctl start or direct execution).
Доказательства
The guard sits in front of 15 of the plists under ~/Library/LaunchAgents/*.plist.
If the 9:00 AM job was skipped for quota reasons and the quota recovers at 10:00, but the next slot is 9:00 AM tomorrow, you've lost an entire day's execution.
- Дата записи: 2026-09-21T17:00:12.510Z