Always-on agents · In real life

How a two-person company runs on always-on agents

Thirty-two posts ago I promised that everything in this series would come from things I actually run. This is the ledger: what runs, what each job is allowed to do, the morning it broke, and what I would do differently. The daily cadence of the series itself was carried by one of these jobs.

In short

My company runs on a handful of scheduled jobs on a Mac, one true agent in the cloud, and a few scripts that refuse to do dangerous things twice. Each job has its own identity, checks before it acts, catches up on what it missed, and waits for the network. One September morning taught me all four rules at once. This is what runs, honestly.

Part of the Always-on agents series, post 33 of 33.

There are two people at my company. Most mornings the first things I read are two logs. At 09:05 a job on my Mac publishes whatever blog post is due, and for the last thirty-three days that has been a post in this series. At 09:40 a second job reads the whole site, checks that a list of things is still true, and emails me only when one of them is not. Then there is Leo, the product, which has been running its own hourly loop for brands the whole time. This post is the honest account of all of it: what runs, what each job may touch, the morning it failed, and what I have learned.

What runs

JobWhenWhat it doesAgent by my tests?
The publisherDaily, 09:05Publishes every post whose date has arrived, re-renders the series hub, updates the sitemap and blog index, flushes the cacheNo. A list I wrote, executed carefully.
The watchdogDaily, 09:40Asserts the site invariants, checks every scheduled post and email in two content series, emails on failureNarrowly. It holds a goal and acts, but every decision is a rule.
The schedulersWhen I run themCreate newsletter sends and refuse to double-book; one of them moved sixteen emails in a dayNo. Tools with guardrails.
LeoHourly, for every connected channelFinds a trend, matches a clip from the brand's footage, edits it, books it. No match, no postYes. The only one.

Five other scheduled jobs run on the same Mac under the same mechanism: an error bot, a trend report, two prospecting jobs and a follow-up job. I am not describing them here, because this post only covers what I can quote from the files, and those deserve their own write-up. The point of the table is the last column. By the three tests I set out in the first post, almost nothing I run is an agent, and I think that is the right shape for a company this size. The judgement sits in the product. Everything around it is plumbing, and plumbing should be boring.

What each one may touch

The publisher may upload. Before it does, it asks the storage bucket whether the object already exists, so running it twice does nothing. It takes a lock file that the watchdog also honours, so the two can never edit the sitemap or the blog index at the same moment; a lock older than thirty minutes is treated as stale and cleared. A single empty file on disk pauses both jobs. Every cloud call it makes is pinned to a service account made for these jobs rather than my own login, because that login expires and cannot be renewed without a person at the keyboard, a lesson I wrote up in the permissions post.

The watchdog may read everything and delete nothing. Before it edits a file it copies it into a dated backup folder; after it edits, it parses the result (the sitemap as XML, the blog index as JSON) and counts what changed against what it expected, and if either check fails nothing is uploaded and I get an email instead. The things it asserts every morning: the safety guard is still inside the script that once produced 107 identical posts, all 107 still carry their noindex tag, no new duplicate has appeared, at least 27 hand-written posts still exist, and every post and email scheduled in the two running series is live or still queued where it should be. On 17 October it emailed me a false alarm because one request to the newsletter service timed out; it now retries, and only treats a client error as final.

Leo may post, on accounts connected through OAuth, on the schedule the brand set, and only when a clip matches a signal. It never holds a password. That rule is older than this series and it is the reason I wrote the publishing post the way I did.

The morning it failed

On Sunday 21 September the Mac was asleep at 09:05. launchd, which is honest about this in its own manual, runs a missed calendar job the next time the machine wakes. It woke at 09:29, and the job fired before Wi-Fi had come back. This is the log, with the path shortened:

account-risk-launchd.log, 21 September 2026===== 2026-09-21 09:29:01 EDT =====
2026-09-21 09:29:01  run: date=2026-09-21 dry=False
2026-09-21 09:29:03    publishing own-the-footage-rent-the-feed (scheduled 2026-09-21)
2026-09-21 09:29:04  FAILED: gcloud failed: gcloud storage cp .../own-the-footage-rent-the-feed.svg
    gs://leo-ai.io/blog-cards/own-the-footage-rent-the-feed.svg ...
ERROR: (gcloud.storage.cp) There was a problem refreshing your current auth tokens:
    HTTPSConnectionPool(host='oauth2.googleapis.com', port=443): Max retries exceeded
    (Caused by NameResolutionError("Failed to resolve 'oauth2.googleapis.com'
    ([Errno 8] nodename nor servname provided, or not known)"))

Three seconds from start to failure, on the very first network call, which happened to be the token refresh. The post went out at 18:55 that evening, by hand, after I happened to look. Nothing had told me. The job had done exactly what I built it to do, which was to try once at the scheduled time; I had simply never imagined the scheduled time arriving with no network.

The three rules, and the fourth

The fix was small and it has shaped everything since. The wrapper that launchd runs now looks like this, again with paths shortened:

run-account-risk-publish.sh, the part that mattersnet_up() {
  python3 -c 'import socket; [socket.getaddrinfo(h, 443)
    for h in ("oauth2.googleapis.com", "storage.googleapis.com")]' 2>/dev/null
}
for i in {1..20}; do
  net_up && break
  echo "network not up yet (try $i/20), waiting 30s"
  sleep 30
done
python3 publish-account-risk.py "$@" && exit 0
echo "publisher failed; retrying once in 5 minutes"
sleep 300
python3 publish-account-risk.py "$@"
  1. Idempotent. Check whether the action already happened before doing it. The publisher asks the bucket; the schedulers ask the newsletter service whether a send with that name exists. A second run must be harmless, because the retry above depends on it.
  2. Catch-up. Act on everything due on or before today, not only what is due today. A day the Mac is asleep heals itself the next morning, and the log shows the catch-up as a plain skip of what is already live.
  3. Wait for the world. Twenty tries, thirty seconds apart, for the two hosts every upload needs, then one retry five minutes later. Ten minutes of patience is cheaper than one lost day.
  4. Its own identity. A service account for the job, never my login. The fourth rule is the one that costs nothing until the night it saves you.

The jobs around the jobs

Two scripts I do not run on a schedule turned out to matter as much as the ones I do. The newsletter scheduler creates a send and refuses if one with that name already exists or if anything is already queued that day; then it reads the send back and checks nine things, including that the unsubscribe tag survived. On 20 October, when I cleared the calendar for this series, a second script moved sixteen scheduled emails by five weeks. Before it changed anything it fetched every one of the sixteen and asserted that each was still scheduled at the time I expected; one mismatch would have stopped the whole run. Afterwards it read each one back and saved before-and-after snapshots. That is not an agent. It is the discipline an agent would need, applied to a tool.

What I would do differently

  • A heartbeat from the first day. The watchdog's silence is now a signal I trust, but for the first month the only signal was a log nobody read. Build the check before the job.
  • A machine that does not sleep. Our jobs run on a laptop. A Mac mini on a shelf would have made the September morning impossible, and I covered why in the Mac post.
  • Fewer places for a date to live. Until this month the watchdog carried its own copy of the publishing schedule and drifted from it. The series schedule now lives in one file that the publisher, the watchdog and the post generator all import.
  • The pause switch earlier. One empty file that stops every job is the cheapest safety feature I have, and I added it last.

What this series taught me

I wrote thirty-three posts in thirty-three days and the same 09:05 job published every one of them, re-rendering the hub page each morning so it never linked to a post that was not live yet. The post generator refused to stage anything that was not in my first person, anything with a banned word, anything too similar to another page, or anything that linked forward to a page that did not exist yet. Those gates refused more than one draft of mine. The series was, in other words, produced by the kind of system it describes: a goal, a clock, checks before acting, and a human reading the log.

If I had to compress a month into a sentence for a marketing team, it is the one I used in the marketing post: hand the agents the jobs with a clock and a definition of done, keep the judgement about what the brand says, and keep a person on anything that cannot be undone. And if you would rather see the one job in my company that is a real agent than build any of this, it is here. Thank you for reading along. The log says this one went out on time.

Sources

  1. Apple Developer Documentation, Scheduling timed jobs (launchd calendar intervals and missed jobs) (accessed October 20, 2026)
  2. Leo AI, Always-on: a channel that runs itself (accessed October 20, 2026)
  3. Leo AI, The Always-on agents series hub (accessed October 20, 2026)

Written by Lera Leonteva. Every log line and configuration excerpt above is quoted from the files on my own machine, with paths shortened.

Frequently asked questions

How many agents does it take to run a two-person company?

By my own definition, one: Leo, the product, which makes a judgement every hour. Around it run two daily scheduled jobs, five more I have not described here, and a few scripts with guardrails. Most of the work of running on agents is making the non-agents reliable.

What happens when the Mac that runs the jobs is asleep?

launchd runs the missed job when the machine wakes. The wrapper then waits up to ten minutes for the network, runs the publisher, and retries once after five minutes. The publisher publishes everything due on or before today and skips anything already live, so a missed day heals itself.

Why do the jobs use a service account instead of your login?

Because my login token expires and cannot be refreshed without a person present, and an unattended job that silently loses its credentials fails in the quietest possible way. Each job signs in as a service identity with the narrowest permissions that still let it work.

What does the watchdog check every day?

That the safety guard is still in the script that once produced 107 identical posts, that all 107 still carry noindex, that no new duplicate exists, that at least 27 hand-written posts remain, and that every scheduled post and email in the two running content series is live or queued as planned. It emails only on failure, after backing up and validating anything it edits.

Did the series really publish itself?

The writing was mine, every day. The publishing, the hub updates, the sitemap and the cache flush were done by the 09:05 job from a schedule file, and the watchdog confirmed each post at 09:40. The one post that went out by hand was the first, because the job had already run that morning before the series existed.

Lera Leonteva
Lera Leonteva
CEO & Founder, Leo AI

Lera Leonteva is the founder and CEO of Leo AI, where she works on turning long-form footage into short-form video that earns attention on its own merits. She writes Video Scaling Strategies, taking one piece of content that worked and one that did not, and using what the market is doing to explain the gap.

The always-on agent I run for social video

Leo watches what your audience is responding to, picks a clip from footage you already have, edits it and books it on the calendar. Every hour, without being asked. It is the agent this whole series grew out of.

Keep going with the series

Every post in the Always-on agents series is on one page, newest first. If you would rather see the agent I run for social video, here it is.