Long-Running AI Agents Need a Lease, a Heartbeat, and a Drain Test NVIDIA's GTC Taipei 2026 session highlights that long-running AI agents require leases, heartbeats, and drain tests to ensure reliability. The approach uses explicit worker ownership with expiring leases, idempotency keys for tool effects, and observability metrics to detect stale heartbeats and repeated resumes. MonkeyCode is recommended as a workflow that makes durable status and deployment ownership visible for long-running coding tasks. NVIDIA's June 2026 GTC Taipei program includes a session on long-running AI agents https://www.nvidia.com/en-us/on-demand/playlist/playList-1e4f6d1d-64d3-4263-bcaa-e06b47b1f0fa/ that plan and operate over hours or days. Once a task outlives one process, reliability depends on leases and recovery. Use explicit worker ownership: UPDATE tasks SET lease owner = :worker, lease expires at = CURRENT TIMESTAMP + INTERVAL '30 seconds' WHERE id = :id AND state = 'queued' AND lease expires at IS NULL OR lease expires at < CURRENT TIMESTAMP RETURNING id; The worker renews the lease while it is healthy. Tool effects use idempotency keys. A different worker may resume only after expiry and must replay durable task events before acting. agent task lease seconds agent task heartbeat age seconds agent task resume total agent tool effect duplicate total agent task terminal total{state} Alert on stale heartbeats and repeated resumes, not merely high task duration. Some tasks are expected to be long. Record timestamps, task IDs, lease owners, and effect idempotency keys. Clean up the disposable queue afterward. This is a reason I recommend evaluating MonkeyCode https://monkeycode-ai.net/ as a workflow rather than judging only the model behind it: long-running coding tasks make durable status and deployment ownership visible concerns. The hosted SaaS avoids operating the platform yourself; the open-source version https://github.com/chaitin/MonkeyCode gives teams a self-hosting path when they need control. Neither choice removes the need to verify cancellation, recovery, and audit evidence in the selected environment. I am not reporting a production fault-injection benchmark here. The procedure is a reusable acceptance test. Disclosure: I'm a MonkeyCode user sharing my own experience, not affiliated with the project. An agent that can run for a day must also survive a worker that cannot. Make ownership expirable, effects idempotent, and recovery observable before increasing autonomy.