Flow
Menu

Reference

Record an agent run, or update the one at this address

The upsert-agent-run tool, and the REST call it is generated from.

RESTPOST /api/v1/agent-runs
MCPupsert-agent-run

Keyed by url: the first call creates the run, later calls update it. Record it when the run starts (works_on, parent, authority) and again when it ends (status, usage; without usage it counts as unpriced). Omitted fields are kept; usage merges per key; works_on and produced only add. `works_on` takes the tasks for the run. One a running run outside this run's family (the runs sharing its root through parent) already holds is not added: it comes back under contended with that run, null when it is in a project you cannot reach. Moving off running releases what the run took. An id you cannot reach is returned under unresolved, not refused. Write only your own run or one it started; runs under one agent are one agent's. list-agent-runs?lingering=true finds runs left running after their work closed.

Body

This operation takes a JSON body. The spec is the contract and it is what the agent reads every turn — seepackages/server/src/rest/openapi/v1/for the shape.

Responses

200The run's acknowledgement
400The request does not match the operation's schema
404No project or task by that id that you can reach

Generated from the spec this operation is implemented against, so the two names above cannot disagree with the surface a client sees.