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
- Hermes Agent: session database with full-text search, agent-curated memory, optional Honcho user modelling, checkpoints and rollback, session rewind (v0.23.0) [1][2]. Honcho is AGPL-3.0 [17].
- For unattended repo work the durable state should be files and git, not model memory: a run directory per job with inputs, the prompt, the model and quantization, tool transcripts, outputs and exit status.
- Use git worktrees or a bare mirror per job so a failed run cannot dirty a working tree. Hermes documents worktree support [2].
Guardrails for jobs that touch git remotes
Ordered from strongest to weakest. Use several.
- 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
ghlogin. A separate bot account is cleaner still. - 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.
- No credentials in the sandbox. Run the agent in a container or under
srtwith no token; a wrapper outside the sandbox takes the resulting branch or patch file and opens the PR. - Local git config. A
pre-pushhook that rejects non-fast-forward pushes and any push to protected branch names;receive.denyNonFastForwardson local mirrors; remotes configured with a push URL that points nowhere for read-only jobs. - Command approval. Hermes
cron_mode: denyand command allowlists; OpenClaw tool deny policies [3][7]. These depend on pattern matching and are the weakest layer. - 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
- A morning digest: one message listing each job, its status, duration, tokens used, and links to the report or PR. Hermes cron can deliver to any configured channel [2]. OpenJarvis ships a morning-digest preset [19].
- Hard limits: wall-clock timeout per job, maximum turns, and for hosted models a spend cap. Hermes v0.23.0 added hard spending limits at the gateway and per-delegation cost reporting [1].
- A dead-man check: if the digest does not arrive, that is the alert.
- Keep transcripts. When a local model claims it ran tests, the transcript is the only way to check.
- Start every new job type in report-only mode for a week before allowing it to open PRs.
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]:
- Gemma 4 E2B, 600 iterations, LoRA on 8 layers: about 4 GB peak, about five minutes.
- Qwen 3.5 9B on an M4 Max 64 GB: about two hours for 600 iterations on a small dataset.
- Sizing guidance conflicts between guides. One says 16 GB handles 7 to 8B QLoRA; another says to stay at about 3B on 16 GB.
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.