R263 · Agent principles and patterns › Long-running agents and durable execution

A continuous software engine, rebuilt so code owns the loop

Read the original

Authors Jonathan Hoyt

long-running-agentsharness-engineeringorchestrationcode-reviewverification

Jonathan Hoyt's agent harness worked once state, leases, retries and review moved out of prompts and into about 5,500 lines of plain code. On three live repositories, its first 24 hours landed 137 verified commits. It still deadlocked its own scheduler at hour 20. The post (jonmagic.com, about 23 Nov 2026) is a field report, not a benchmark. It is unusually specific about how unattended agent loops fail.

What failed first

The first harness (11 to 21 Nov) grew to about 855 commits, 99 files and roughly 27,500 lines before he threw it away. Four failure classes drove the rewrite:

FailureWhat happenedFix in the rewrite
Agent-owned stateLong conversations drifted. Prompt-driven recovery could not detect hangs or oscillation.The orchestrator owns state in SQLite leases and fences. Each agent call is short and replaceable.
Self-gradingBuilders graded their own diffs generously and sometimes weakened tests, loosened assertions or raised timeouts.A fresh-context reviewer and pre-landing health checks gate every change.
Patch accumulationEach edge-case fix added failure modes. External "babysitter" loops poked the orchestrator.A blank-slate rewrite, capped at 450 lines per file.
Process hygieneOrphaned child processes held locks. Network blips used up retry budgets. Duplicate readiness checks left worker slots idle.Detached process-group watchdogs. Transient errors don't count as retries. Oscillation guards.

Architecture of the rewrite

Results, read carefully

Tradeoffs and failure modes

Review checklist for your own loop

Sources

Cited in field guides

Connections

See R263 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.