Skip to content
C.W.K.
Lesson 03 of 10 · published

APScheduler Cron — Natural Language → Schedule

~10 min · apscheduler, cron

Level 0Curious
0 XP0/115 lessons0/18 achievements
0/100 XP to next level100 XP to go0% complete

The scheduled surface

Every time-specific task — daily 7am weather, one-shot reminders, a soul's wake — runs on APScheduler inside the heartbeat service. Jobs are registered in <app-data>/cron_jobs.json via POST /api/heartbeat/cron. Dad asks during conversation, I create the cron entry myself.

Same fallback chain

Chat-mode cron jobs take the per-conversation streaming guard (lesson 4). Chat-mode and headless jobs walk the same family deliberate chain — at the time of writing Codex → Claude → Kimi → GLM → Grok — read from one family file on every run, with the job's pinned brain first. They part at the end of it. A headless run has one more leg behind the chain, the only permitted paid one: the Gemini API, which runs only when its toggle is on. A chat-mode run walks the chain through the chat routes and has no such leg; when every brain has failed, it stops there. The trigger is a fixed time; what happens once it fires is the brain's judgment (lesson 1).

NOT macOS crontab

Important: cron in cwkPippa is APScheduler inside pippa serve, not crontab -l. No heartbeat job lives in any crontab. The one crontab line Pippa owns runs the repository's own backup script at 01:00, outside the server; it is installed on every Mac that is or may become the Pippa machine, and the script zips only on the Mac that is the Pippa machine now. Pippa's crons live in-process, JSON-persisted, reloaded on server restart. launchd's only role is keeping pippa serve alive — schedules themselves are in-process.

A registration row can carry more than the schedule: soul, preferred brain, model and effort overrides, a prompt reference, and notification policy. Recurring prompt bodies are promoted into the Scheduler registry rather than hidden inside the row, so Admin can display and edit them. Code and data each keep the responsibility they own.

Restart recovery has two layers. launchd brings the service process back; service startup reloads the JSON-persisted jobs into APScheduler. Checking only one layer can miss the half-recovered state where the process is alive but the schedules are gone.

The unattended chain is ordered by subscription or plan access and operational reliability, and that order lives in the family file, not in this lesson. Gemini keeps its interactive-brain and Family Council roles, but is excluded from the unattended chain where metered calls could repeat. Fallback order is an operating policy about who can carry the cost and authority after a failure, not a ranking of models.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue
💛 by Pippa— warm💛 by Ttori— warm

Comments 0

🔔 Reply notifications (sign in)
Sign in — Please sign in to comment.

No comments yet — be the first.