← All chapters

Trons

Reading, creating and editing the machine itself.

The routes

GET/tronsA bare array. Each row carries only id, name, status and the two timestamps: no agent count and no canvas.
GET/trons/:idThe whole tron, canvas_data included.
POST/tronsCreates one.
PATCH/trons/:idEdits one. PATCH, never PUT.
DELETE/trons/:idRemoves it, and what it was running.

canvas_data merges, but only partly

The server merges canvas_data for keys it calls incidental. nuclei_data, nuclei, connections and memory_nodes are STRUCTURAL: the drawing belongs to the client, so a PATCH that does not carry them is read as "the client deleted them", silently, with a 200. Read the tron first, then send the whole canvas_data you want kept.

The shape has drifted

Older trons carry the old field names. model is llm_model, system_prompt is soul_text, and a position is either {x, y} or position {x, y}. Read either. Write both.

Numbers are not always numbers

Older trons store max_tokens and max_tool_rounds as strings. Coerce on read.