Sailor · Long-horizon agents · Draft · 2 min read
A coding agent needs a place to return to.
A long-running coding task is not one very long model call. It is a sequence of interruptions the system has to make sense of.
The happy path is the least interesting path.
An issue comes in, an agent changes some code, and a pull request appears. That is an appealing demo. But a real coding task also includes review comments, CI failures, a worker disappearing, a command still running, and a budget ending before the work does.
Sailor is where I explore what the system around a coding agent needs to do with those interruptions. It uses Anchor for the agent loop. Sailor owns the application-level state: GitHub events, the queue, the thread, the worker, the workspace, and the decision about what may be published.
The task has to outlive the process.
If the only authoritative state is inside the worker that happens to be running, a process failure becomes a reasoning failure. The next worker has to guess what was done or start over. A durable task needs a record outside that process.
Sailor uses persisted thread and run state, leases and heartbeats, queued work, and checkpoints. The point is not that every interruption becomes free or that a resumed run never repeats any thinking. The point is that the application has something concrete to restore and inspect instead of treating a vanished process as the end of the task.
New information should arrive at a valid boundary.
A review comment can change the direction of the work. That does not mean it is safe to splice a new user message into the middle of an assistant/tool exchange. The transcript has a protocol, and tools may already be changing the workspace.
I want incoming work to be explicit about timing. A queued message leaves the active run alone. An interjection asks for a switch at a safe boundary. Anchor provides that distinction in its inbox contract; an application still needs storage, ownership, and a worker-wake policy. Those mechanics are part of the experience of a long-horizon agent, not incidental queue plumbing.
Finishing and publishing are different decisions.
A model can be confidently finished without having tested the change that is about to leave the sandbox. Sailor adds an application-owned publication check using recorded test evidence and the current tree. The runtime's answer alone is not enough to authorize publication.
This is not a claim that a tree hash proves correctness, that every relevant input is tracked by Git, or that a successful command means the right suite ran. It is a useful boundary: publication should depend on inspectable evidence and host policy, not just the final sentence in the conversation.
A budget ending is a handoff opportunity.
Running out of allowance should not silently grant the agent another allowance. It should also not require throwing away useful work. A handoff can record what remains, while the application decides whether to fund a continuation or ask a person.
The deeper pattern is the same in review, recovery, and budget exhaustion: preserve enough state that the next turn can be a continuation of the same task. That is what makes long-horizon execution interesting to me. Not a loop that never stops, but a system that knows how to stop and come back.
A long-horizon agent is not one uninterrupted run. It is a task whose state can survive the runs that work on it.