ObanCodex.Outcome (oban_codex v0.1.0)

Copy Markdown View Source

Default mapping from Codex execution outcomes to Oban verdicts.

Codex outcomeOban verdictWhy
%Result{success: true}:okthe worker's handle_result/2 decides what follows
%Result{exit_code: 126 or 127}{:cancel, :command_unavailable}the configured executable cannot run; retrying cannot repair it
any other non-zero %Result{}{:error, {:command_failed, code}}bounded retry; Codex has no stable typed CLI-error envelope
%Error{kind: :timeout}{:error, :timeout}transient and bounded by max_attempts
%Error{kind: :spawn}{:cancel, :spawn}deterministic process setup failure
other normalized %Error{}{:error, kind}retry under Oban's normal attempt bound
an unnormalized error term{:cancel, term}off-contract and unsafe to retry blindly

The classifier returns an envelope, {oban_return, payload}. The worker unwraps the first element for Oban while preserving the payload for handle_result/2 or handle_error/3.

Override :classifier when your deployment can classify Codex's human-readable non-zero output more precisely (for example, distinguishing an expired login from a temporary provider outage).

Summary

Functions

Map a query outcome to the {oban_return, payload} envelope.

Functions

classify(arg)

Map a query outcome to the {oban_return, payload} envelope.