Skip to main content
Six words carry the rest of this documentation. This page puts them in one picture and then walks a single message through all of them.

One message, end to end

1

The message arrives at the harness, not at an agent

A chat is attached to a machine, and a machine runs exactly one harness at one ref. So the message has an address — this harness, this commit — before anybody has decided who answers it.
2

handle(msg) says who takes it

programs/splox is the program a chat is answered by; the name is fixed, because a person opens a harness rather than a program. Its handle(msg) is asked:
msg carries text, chat_id and user_id. Answer with an agent this program declared. The agent named is written down as the run’s agent, so a run asked twice — a retry, a wake-up, somebody reading the trace next week — names the same agent every time.
3

The same file is asked who that agent is

The prompt, the model, the provider, the tools and the iteration cap are not settings the platform stores. They are a question it asks main.py at the moment it needs the answer, and the answer is whatever the file says right then:
A chat message is a run, so a line edited between two messages is read by the second one — with nothing published in between.
4

The turn runs, with that program's hooks around it

hooks/context.py builds what the model is given. hooks/model.py may name a different model for this turn. hooks/tools.py sees every call before and after it runs. hooks/guard.py decides whether the turn may go on. hooks/errors.py answers a provider that failed. Hooks belong to their program: an agent of another program runs on that program’s files. See Hooks.
5

Tool calls execute on the machine

A tool is a Python function, and it runs inside the machine’s sandbox — with its filesystem, its network and its installed packages. Editing a tool file in the checkout changes the tool on the next call, with no publish and no restart.
6

What is left behind is a run

Messages, outputs, events, usage, and a tree if the agent handed work to a sub-agent. A spawn is an ordinary run in a chat of its own, parented to the caller’s, belonging to the same program and running on the same hooks. See Runs.

The three things worth internalizing

One machine, and it persists. Files written in one chat are found by the next one. Programs started in one turn keep running after it ends. The machine is the unit of continuity, not the conversation. Asked, not stored. Almost nothing about an agent is configuration the platform holds. The run keeps an address — the program and the agent’s name — and every other answer is asked of the tree in the sandbox at the moment it is needed. Published, not deployed. git push origin main from the checkout makes a new version. The next chat opens on it; a run already going keeps the version it started with, so nothing you push interrupts anything that is running.

Machine

Harness

Program

Agent

Run

Model