Research date 2026-11-18

Long-horizon and unattended operation

How to schedule jobs, keep their state, stop them from pushing where they should not, and find out in the morning what happened. Also energy cost and fine-tuning.

Scheduling

Scheduler Where Good for Watch out for
launchd LaunchAgents macOS Anything that must survive reboots; runs in the user session so TCC grants apply Silent failure. A job pointed at a missing model file can fail on every start without anyone noticing. Jobs need a health check and an alert.
systemd timers Linux Same, with sandboxing directives built into the unit n/a
Hermes cron both Natural-language jobs, per-job model and reasoning pins, delivery to a chat or a file, script-only "no-agent" jobs, webhook-triggered jobs; cron_mode: deny by default [2][3] Unpinned jobs follow whatever the main model is when they fire. Pin the model per job.
Hermes kanban and /goal both A queue of tasks with worker processes; iterate-until-done with a judge and a turn budget [2] A judge model can be wrong; keep the turn budget low.
Headless coding agents (claude -p, codex exec, opencode run) under launchd or systemd both Repo work with the strongest models Exact flags not re-verified today.
OpenClaw cron and heartbeat both Similar to Hermes Not re-verified in detail today.

What launchd and systemd do not give you is uniform health reporting across jobs. That is gap 8 on the roadmap.

Persistence, memory and checkpoints

Guardrails for jobs that touch git remotes

Ordered from strongest to weakest. Use several.

  1. Credential scope. A fine-grained GitHub token limited to the specific repos, with contents read-only for triage jobs. For jobs that must write, a separate token that can push only to a bot-owned fork and open pull requests. Never your main gh login. A separate bot account is cleaner still.
  2. Server-side rules. Branch protection or rulesets on the default branch: no direct pushes, no force pushes, required review. This holds even if the agent misbehaves.
  3. No credentials in the sandbox. Run the agent in a container or under srt with no token; a wrapper outside the sandbox takes the resulting branch or patch file and opens the PR.
  4. Local git config. A pre-push hook that rejects non-fast-forward pushes and any push to protected branch names; receive.denyNonFastForwards on local mirrors; remotes configured with a push URL that points nowhere for read-only jobs.
  5. Command approval. Hermes cron_mode: deny and command allowlists; OpenClaw tool deny policies [3][7]. These depend on pattern matching and are the weakest layer.
  6. Output contract. Every job ends in one of: a Markdown report, a patch file, or a draft PR. Nothing merges without a human.

For pulling and triaging upstream changes across forks, the right approach is: git cherry for patches not yet upstream, git merge-tree for a clean-merge check with no working tree, the model labelling only.

Supervising overnight runs

Cost and energy

Using Apple's wall-power figures [26] and an assumed electricity price of 0.17 USD per kWh (my assumption; substitute the real rate):

Scenario Energy per year Cost per year
M4 mini idle all year (4 W) 35 kWh about 6 USD
M4 mini at maximum 8 h per night, idle otherwise about 213 kWh about 36 USD
M4 Pro mini idle all year (5 W) 44 kWh about 7 USD
M4 Pro mini at maximum 8 h per night, idle otherwise about 438 kWh about 74 USD

Maximum draw is an upper bound; inference load is normally below it. Energy is not the constraint. The real costs are the hardware, your time, and hosted tokens for the hard steps. I did not verify hosted model prices today and so give none. I also did not verify current Mac mini prices; the M4 generation is no longer the current one.

Fine-tuning and training on M4 minis

What the tooling does (verified from mlx-lm's LORA.md) [52]: mlx_lm.lora supports LoRA, DoRA and full fine-tuning; pointing it at a quantized model gives QLoRA automatically; mlx_lm.fuse merges adapters and can export GGUF for a limited set of architectures; memory is reduced with smaller batch size, fewer layers and gradient checkpointing. MLX-LoRA-Studio is a native Mac GUI for the same (MIT, 290 stars) [17].

Data points, all secondary and none on a Mac mini specifically [53]:

A working example of what a small adapter buys: Speakrail ships a Gemma 4 E4B LoRA that makes turn-taking decisions in one token per event [44].

Realistic scale on the minis, as my estimate from the above and from the bandwidth gap between an M4 Max and a base M4:

Machine Feasible Not feasible
M4 16 to 24 GB QLoRA adapters on 2 to 9B models, hundreds to a few thousand examples, minutes to a few hours Anything 12B and up at useful sequence lengths
M4 32 GB QLoRA up to about 12B; 9B comfortably 27B and up
M4 Pro 64 GB QLoRA on 12 to 27B with short sequences and small batches, overnight Full fine-tunes; MoE 35B-class adapters are untested territory

Training from scratch or full fine-tuning of anything useful is not a mini workload. The sensible use here is narrow: train a small adapter on gold labels for one narrow task, such as triage labelling, so a 4 to 9B model does it at high speed, and measure it against a rules baseline. Rent a GPU for anything bigger.