Expand description
ApiError: the one error type every handler returns, and the JSON
envelope it serializes to.
Every failure the control plane reports has the same shape on the wire, so a thin SDK can decode one thing:
{ "error": { "code": "unknown_run", "message": "...", "details": { ... } } }code is a stable machine token (an SDK matches on it); message is a
human sentence; details is present only when there is structured evidence
to carry. The reconciliation refusal is the original case (the recorded write
intent travels in details.intent, mirroring the CLI’s report); the fork
endpoint’s write_replay_hazard carries the same kind of evidence in
details.writes (the exact writes a fork would re-fire), which is the
refuse-then-record differentiator on the wire.
Each variant fixes its own HTTP status, so the status and the body’s code
never drift: a 404 always carries unknown_run or unknown_agent, a 409
always carries a conflict or a reconciliation refusal, and so on.
Enums§
- ApiError
- A control-plane error, with the HTTP status and machine code baked in.