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