orchestratr
reference

error codes and exit codes

the nine stable error codes, each code's details shape and process exit code, the full exit-code table, and the wait-timeout vs agent-timeout distinction.

orcr has a deliberately small error enum: nine stable codes, with everything finer carried in details. adding codes later is easy; removing them is not. every --json error is {"ok":false,"error":{code,message,details}}, and the CLI maps each code to a process exit code.

the codes and exit mappings here come from src/error.rs and are exposed in the schema under ERROR_CODES (also exported by the SDK). each code has one SDK error class; see the SDK reference.

the nine codes

codeexitwhendetails
not_found6a target resolved to nothing{target, candidates?} (shortest disambiguating uuid prefixes when ambiguous)
invalid_request1bad flags, names, durations, cron, frames, methods, or JSON{field?, value?, reason} (for example reason: "path_too_deep")
state_conflict7wrong state for the verb{current_status, reason?}: reason: "force_required" for unmanaged kills, reason: "path_in_use" with the occupying {uuid, path, status}
blocked4a waited agent needs a human{blocked_kind} (question / limit / login / unknown)
timeout3a direct command's own deadline expired{elapsed}
integration_missing2a provider is missing an integration layer{provider, missing:[orcr|herdr], install} (the exact install command)
transcript_unavailable1no final response is identifiable, including ambiguous or stale transcripts{uuid, status, cause?}
environment_error2server, store, herdr, home, platform, or version problem{cause, …} (see below)
server_error1internal failure (spawn, signal, cursor){cause, …}

environment_error causes

environment_error covers the setup and platform failures. the cause field names the specific problem:

causemeaning
herdr_unreachablethe server is fine but herdr is not (not discovered, or its socket is unreachable)
server_start_failedthe server could not be spawned
server_unreachablea client could not connect to the socket
store_lockedanother process holds the store
config_invalida known config key failed strict validation
unsafe_home~/.orcr is not owned by the current uid, or is group/world-writable
unsupported_platformserver enable/disable on a platform with no service unit
unsupported_versionprotocol version mismatch (orcr client to server, or server to herdr)

the full exit-code table

exit codes come from two places: the error enum above (a failed command), and the outcome of wait and kill (which can exit non-zero without an error envelope). the complete set:

codemeaning
0success; for wait, every target settled successfully
1other: invalid_request, transcript_unavailable, server_error
2environment: integration_missing, environment_error
3timeout: an agent's or run's own deadline; also a wait's own --timeout
4blocked: an agent needs a human
5killed / ended: a wait target died (killed, canceled, timeout, failed, or lost)
6not found
7state conflict (wrong state; force_required for unmanaged kills)

exit code 5 is a command outcome, not an error code: it comes only from a wait observing a dead target (killed, canceled, timeout, failed, or lost). a kill never exits 5: a kill where every matched target is skipped (already ended, or needs --force) exits 7 (state_conflict), and a kill that matches nothing exits 6 (not_found). see the status model reference for how each observed state maps to a wait reason token and exit contribution.

wait-timeout vs agent-timeout

these look similar but are not the same:

  • an agent's or run's own --timeout expiring is the timeout error code (exit 3, details.elapsed). the agent is killed with exit_reason: timeout. a wait observing it reports the timeout reason token (exit 5, because the target died).
  • a wait-style command's own --timeout expiring is not an error. the envelope stays ok:true with a partial result (timed_out:true), and the process exits 3. the call succeeded; the targets just had not all settled. unsettled targets show the wait_timeout reason token with their current status.

the single rule: ok:true + timed_out is a partial success; the timeout error code is reserved for a deadline the command itself set on an agent or run.

On this page