the paper
A Query-Optimizer Architecture, Its Economics, and the Limits of Overnight Coding Agents
Coding agents call models the way a person would: one synchronous request at a time, at the full realtime price. But much of what agents do best — backlog burndown, migrations, test-coverage pushes — has nobody waiting, and every major provider already sells the product for that shape: a batch API, 24-hour window, half price. LazyCode compiles deferrable model calls onto that tier. A realtime model plans; the plan then runs overnight as barrier-synchronized waves of self-sufficient batch calls, and the barriers, memoization and three-window crash recovery are what make paying a provider unattended safe. The design transplants database query processing: operator algebra, rewrite rules, physical waves, a write-ahead log. We separate what is implemented (18,415 LOC, 413 default-suite tests) from what is merely designed or vocabulary. On cost, batch's ∼50% discount on output tokens is unconditional; against a prompt-cached interactive baseline it wins on input only when T interactive turns compile to R < T/5 batch rounds. Where batch and cache discounts stack — provider-dependent, unverified here — width relaxes that condition, reaching R < 2T only in the N → ∞ limit. One small upstream change — deferred model requests — is what blocks durable-execution frameworks from treating model calls like deferred tools.
@misc{lunkupalivenugopal2026lazycode,
title = {LazyCode: Compiling Interactive Intent into Batch Execution ---
A Query-Optimizer Architecture, Its Economics, and the Limits
of Overnight Coding Agents},
author = {Lunkupali Venugopal, Gurunath},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.21905469},
url = {https://doi.org/10.5281/zenodo.21905469}
}