Lindsay Edwards

The Overnight Agent Is A Relay, Not A Marathon

My first design for an unattended overnight agent was wrong, and it was wrong in the obvious direction. I tried to make it smarter.

The job was an audit and fix loop for Modus Future projects: review the app, file findings, plan fixes, execute them, verify, repeat. Run it while I sleep. A long-running agent fails this brief three ways.

It rediscovers. Every round refinds the same bugs unless “known issues” is generated from a durable ledger instead of a hand-written list.

It inflates. Deep-dive agents always find something, so without a severity floor the loop grinds cosmetic issues forever.

And it cannot be trusted at 3am. Tenancy, money, auth and migrations should never be auto-fixed while nobody is watching.

The design that works is a state machine on disk. Each invocation reads a state file, executes exactly one phase, writes state, and exits. A checkpoint tag is cut at the start of every round so there is one named handle for “put it back”. Heavy models only review findings and write plans. Cheap sub-agents execute. The dangerous categories park for morning review instead of stalling the loop.

Think of a hospital shift change. No nurse works 24 hours. The chart carries the patient between shifts, and that is what makes the care continuous, not any one heroic person staying awake.

A crash now costs one phase, not a night.

The agents did not need more intelligence. They needed a shape that survives them.

Keep reading