AI Coding Agents
Engineering Management
Keeping long-running coding agents on track
September 24, 2026 - 2 minute read
AI Coding Agents
Engineering Management
September 24, 2026 - 2 minute read
Long-running coding agents fail gradually. Scope expands, earlier decisions disappear from working context, tests drift away from the original requirement, or a worker keeps retrying the same blocked approach. Reliable multi-day work needs control points that expose those failures before they spread.
The task should begin with a bounded outcome and a finite set of behavioral checks. Factory's Missions architecture calls this a validation contract. The system defines observable success before implementation, then organizes work into features and milestones that can be checked independently.
A milestone should deliver a coherent capability that a reviewer can inspect. "Finish backend" is too broad. "Create the read-only endpoint, preserve existing authorization, and pass its contract tests" has a visible boundary and evidence.
Keep dependencies explicit and order milestones so early work reduces uncertainty. Pilot one representative path before repeating a change across many packages. Isolate risky migrations and integrations rather than mixing them with mechanical edits. Each milestone should name the tests, browser flows, or artifacts required to advance.
Factory Missions planning separates worker completion from milestone validation. Fresh validators inspect the result against the original behavior instead of inheriting the implementer's reasoning. That separation helps detect a solution that is internally consistent but wrong for the requested outcome.
Long sessions eventually exceed a model's useful working context. Factory's research on context compression evaluates whether summaries preserve facts, artifact state, decisions, and next steps. The operational lesson is simple: essential state needs a durable structure.
Record the approved plan, current milestone, files changed, decisions made, failed approaches, test results, and remaining blockers. Keep repository conventions in AGENTS.md and task-specific state with the mission. A new worker should be able to continue without replaying the entire conversation.
Update shared state after meaningful changes rather than only at the end. If a requirement changes, revise the plan and acceptance criteria before more code is written. If a test result is stale after a later edit, mark it stale instead of carrying it forward as evidence.
Commits and pull requests are useful checkpoints, but they are not the whole record. Preserve why a decision changed and which evidence justified it, especially when a later worker may otherwise repeat an abandoned approach.
Set conditions that return control to a human. Examples include repeated failure of the same check, a required credential that is unavailable, a proposed change outside the approved scope, or a migration whose rollback cannot be demonstrated. Stopping with a precise blocker is safer than producing an unverified completion claim.
Factory's Mission Control guidance supports monitoring, intervention, and validation during execution. Operators can pause work, narrow scope, revise requirements, or ask the orchestrator to reassess a stalled feature. These interventions belong in the work record.
At closeout, compare the final behavior with the original contract, not with the latest plan summary alone. Review the diff, run the named checks, preserve evidence, and list anything deferred. Long-running autonomy becomes manageable when progress is a sequence of verified state changes rather than one uninterrupted agent session.
Start building