← Back to PRs

#7367: refactor(cron): rename wakeMode to postRun

by BrennerSpear open 2026-02-02 19:04 View on GitHub →
docs app: macos app: web-ui gateway cli commands agents
## Summary - Renames the confusing `wakeMode` field to `postRun` across the entire codebase - `wakeMode: "now"` → `postRun: "trigger-heartbeat"` and `wakeMode: "next-heartbeat"` → `postRun: null` - Adds backwards-compatible migration so existing `jobs.json` configs are automatically upgraded on load ## Motivation The `wakeMode` name misleadingly suggests it controls *whether* cron jobs run, when it actually only controls post-execution heartbeat behavior. `postRun` with explicit values makes the purpose clear at a glance. ## Changes - **Core types**: `CronWakeMode` → `CronPostRun`, old type kept as deprecated alias - **Migration** (`normalize.ts`): reads legacy `wakeMode`, maps to `postRun`, deletes old key - **Schemas** (TypeBox + Zod): accept both old and new field names for backwards compat - **CLI**: `--post-run` flag added, `--wake` kept as deprecated alias - **Gateway hooks**: configs accept both `wakeMode` and `postRun` - **Swift macOS app**: `CronWakeMode` enum → `CronPostRun` with coding key migration - **Web UI**: labels updated ("Post-run" / "Trigger heartbeat" / "None") - **Tests**: all updated (804/805 pass — sole failure is unrelated macOS-only launchd test) - **Docs**: English + Chinese updated with new naming and backwards compat notes ## Testing - `bun test` passes 804/805 test files (4996/4999 tests) - Only failure: `launchd.test.ts` — macOS-specific, pre-existing, unrelated to this change - TypeScript build (`bun run build`) passes cleanly > 🤖 This PR was AI-assisted. All changes were reviewed and the full test suite was run.

Most Similar PRs