Coding and Software-Engineering Agents › Long-running and multi-step tasks
Language AI HandbookAll chapters The toy example fits in one turn. Real engineering work does not. A typical issue touches several files, takes many edit-test cycles, and may run for tens of minutes to hours. This creates a set of concerns that are specific to long-horizon agents and that we should name even though the full treatment belongs in Part XLIX, Ch 4 and Part XLIX, Ch 8.
Resumability. Retain the starting revision, working changes, test results and next planned step. Git records tracked content, while a separate trace can preserve decisions and command outcomes.
The second is step and time budgets. An agent can loop forever on a flaky test. You need a hard cap on iterations, wall-clock time, and (for cost) total tokens, plus a "give up and hand off to a human" path. This is not a limitation to work around; it is a design requirement. A coding agent that runs until it decides it is done is a liability. The budget is also a predictability mechanism: a team adopting an agent wants to know that a task will either succeed or escalate within a bounded cost, not that it might run all night and burn a budget.
Convergence detection. Stop editing when the declared acceptance checks pass. Here they include the target test, earlier passes, the independent checks and the mechanical scope check. Hand the candidate to the reviewer. A green visible suite alone does not meet that acceptance criterion.
Context management. Over several iterations, keep a concise working summary of the available evidence, unresolved questions and next action. Supply that summary to later model calls and retain the raw command and decision trace separately for audit.
Environment drift. Version the dependencies and execution image, and retain the test inputs. Even in a pinned environment, test scheduling, external state or randomness can produce different results.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!