Skip to content

Failures and diagnostics

llm-core uses typed outcomes for expected operational states and throws for invalid contracts, forged runtime facades, and coordination responses that cannot be trusted. This page collects the public failure families; capability pages remain authoritative for recovery behavior.

Boundary and model failures

SurfaceFailure formMeaning
Tool argument validationToolArgumentValidationErrorArguments do not satisfy the registered strict schema.
Model response{ kind: "error", error: ModelError }A provider call completed with provider-error, rate-limited, timeout, cancelled, invalid-request, content-filter, or unknown.
Contract boundaryTypeErrorPortable data, identity, version, schema, or runtime provenance is invalid.

Model errors carry a portable code and message. Provider-native codes and metadata remain optional edge data. See Model and media.

Model resolution diagnostics

ModelResolutionOutcome is either resolved with one exact ModelResolution, or unresolved with a reason and ResolutionDiagnostic values:

Unresolved reasonMeaning
no-eligible-bindingNo registered binding satisfies capabilities and policy.
ambiguousMore than one eligible binding remains.
unknown-selectionAn explicit model selection matches no known binding.

Diagnostics retain the selection, exclusion, version, constraint, policy, and evaluator decisions that produced the outcome. They are separate from provider execution errors because resolution occurs before a model call.

Capability binding diagnostics

CapabilityCandidateResolutionOutcome is either resolved or unresolved. Both variants carry CapabilityBindingDiagnostic values so selection, duplicates, unsupported ranges, missing candidates, and invalid candidates remain inspectable without parsing an exception message. Resolution consumes inert, evidence-validated descriptors only. An unresolved required capability must be handled before any acquisition factory can run.

Controlled effects

ControlledToolExecutionOutcome keeps recovery-significant states distinct:

StatusCaller action
succeeded, failedConsume the result and authoritative receipt.
awaiting-approvalRetain the reservation and resume with authenticated approval.
denied, cancelledTreat the effect as not authorized or cancelled under the recorded disposition.
existingUse the authoritative terminal receipt; do not replay the effect.
conflictReconcile the competing idempotency reservation.
indeterminateReconcile externally before any retry.

Malformed journal acknowledgements and other untrustworthy coordination responses throw ToolExecutionCoordinationError. See Controlled tool execution.

Resume and agent outcomes

ResumeCompatibility reports whether a registered checkpoint can run under the expected runtime and contract facts. The runtime integration owns the result of a native resume attempt. When a meaningful effect is recorded as started or indeterminate, the integration must reconcile it before retry.

An AgentResult terminates as completed, failed, denied, or cancelled. Its optional reasonCode is a safe machine-readable category, not provider-native error payload. See State and durability and Agents and runtime integrations.