lucidAGENTS
Reference

Errors

Machine-readable HTTP errors, retry decisions, and ambiguous payment outcomes.

Lucid HTTP handlers return JSON errors with a machine-readable code:

{
  "error": {
    "code": "invalid_input",
    "message": "Safe summary or validation details"
  }
}

The status code identifies the broad class. The error code determines the operator or client action. Do not retry, repay, or expose internal details based only on 4xx versus 5xx.

Core invoke and stream errors

CodeStatusMeaningClient action
entrypoint_not_found404No registered entrypoint matches the key.Correct the URL or refresh discovery.
not_implemented501The entrypoint has no handler for that operation.Do not retry until the service changes.
invalid_request400The request body is not valid JSON or has the wrong outer shape.Fix the request; do not pay again blindly.
invalid_input400Input failed the entrypoint schema.Fix the fields described in issues.
invalid_output500The handler returned output that failed its declared schema.Operator bug; use the same idempotency key when checking recovery.
stream_not_supported400The entrypoint has no stream handler.Use invoke or a stream-capable entrypoint.
internal_error500An unclassified handler or stream failure occurred.Treat the outcome as ambiguous if payment or side effects may already exist.

Metadata routes use not_found with 404 when an optional document such as the OASF record is not enabled. That differs from entrypoint_not_found: it means the route exists, but the requested discovery surface is unavailable.

Task routes additionally use:

CodeStatusMeaning
a2a_tasks_not_enabled404No Lucid task runtime is installed.
skill_not_found404The requested card skill does not resolve to an entrypoint.
task_not_found404No task exists or the caller is not allowed to observe it.
task_access_required400 or 401The task token is malformed or absent.
task_execution_failed503The reservation or background execution could not be started.
invalid_state400 or 409The requested task transition is invalid for its current state.

Once a task has started, failure is represented on the stored task or SSE event rather than as a new route response. Mapped handler failures use invalid_input, invalid_output, or internal_error; the in-memory executor uses task_timeout when maxRunMs expires. The client may synthesize parse_error if a task SSE event is not valid JSON. Applications can also return domain-specific TaskError.code values, so treat this field as an open string after handling the Lucid codes you depend on.

Lucid's current task routes are not the official A2A v1 binding. See A2A protocol status before writing interoperable error handling around them.

Payment and authorization errors

CodeTypical statusSettlement meaningSafe action
payment_required402No verified x402 payment yet.Evaluate the advertised requirement, approve it under policy, then retry once with a credential.
auth_required401 or 402A SIWX challenge is required.Sign the canonical challenge and retry once.
auth_failed401SIWX verification failed.Refresh the challenge; do not reuse an invalid or expired credential.
policy_violation403Payment/fulfillment was not admitted.Change the request or approval policy; never bypass the control automatically.
policy_storage_error503Policy capacity could not be checked atomically.Fail closed and restore the policy store before retrying.
payment_configuration_error500 or 503Required rail, network, destination, or provider configuration is absent/inconsistent.Operator action; do not downgrade to a free request.
authorization_configuration_error503An auth-only entrypoint lacks an enabled SIWX runtime/store.Fix deployment configuration.
authorization_admission_failed503Capacity reservation failed before execution.Usually safe to retry after the store recovers, using the same idempotency key.
authorization_abort_failed503A provisional reservation could not be released.Reconcile reservations before accepting more traffic.
authorization_finalization_failed503Settlement/finalization threw after execution began.Ambiguous: query facilitator evidence and the idempotency record before retrying.
payment_reservation_release_failed503Incoming policy capacity could not be released after an application failure.Reconcile reservation state before retrying or admitting more traffic.
settlement_failed402 or 503Settlement was rejected definitively (402) or settlement execution threw (503).Distinguish rejection from unknown submission outcome before any retry.
payment_recording_failed503Settlement may have succeeded but accounting or SIWX entitlement persistence failed.Treat as potentially paid; reconcile, do not submit a new credential automatically.
mpp_configuration_error503MPP methods or verifier configuration cannot serve the challenge.Operator action.
mpp_verification_in_progress409The same MPP challenge is already leased for verification.Back off; use the same validated idempotency key where supported.

Facilitators and upstream payment libraries may return additional structured errors. Preserve their status and correlation data internally, but do not assume an undocumented provider body is stable.

Idempotency errors

Invoke idempotency is activated only when the client sends an Idempotency-Key. Keys must contain 20–256 characters.

CodeStatusMeaningRetry rule
invalid_idempotency_key400The key length is outside the accepted range.Generate a valid key and send it only if the original request was not admitted.
idempotency_in_progress409Another owner holds the same request claim.Respect Retry-After; poll with the same key and identical request.
idempotency_key_conflict409The same key was used for a different fingerprint.Stop; use a new key for the genuinely different operation.
idempotency_store_error503Claim, release, or completion persistence failed.Check whether execution/settlement occurred before retrying.
idempotency_claim_lost503The in-progress lease expired before completion.Ambiguous; inspect fulfillment and payment evidence. Increase the TTL if runs can exceed it.

A successful replay includes Idempotency-Replayed: true. A replayed response is evidence that the stored invocation result was returned, not that a new payment was submitted.

Retry decision table

ObservationAutomatic retry?Credential/key behavior
Initial 402 payment_requiredOnce, after local approvalAdd a fresh payment credential; keep the same business idempotency key.
400, 403, or 404NoCorrect intent/configuration first.
409 idempotency_in_progressYes, bounded backoffSame request and same idempotency key; do not create a second payment intent.
Network failure before any response bytesMaybeSame idempotency key; first check client/provider evidence when available.
503 before authorization admissionAfter dependency recoverySame idempotency key.
authorization_finalization_failed, payment_recording_failed, timeout after payment submissionNo blind retryQuery settlement and stored response/task state before deciding.
Stream disconnect after 200Not as a new paid streamStreaming settles on admission; resume only through application-defined semantics.
Task creation returned a task IDPoll the taskDo not recreate the paid task merely because execution is slow.

See Retries and idempotency and Payment lifecycle for the complete state machine.

Logging contract

Log enough context to distinguish payment, fulfillment, and persistence:

  • request/run ID, entrypoint, operation, and validated idempotency key hash;
  • payment protocol, network, asset, atomic amount, payer/payee identifiers, and facilitator/receipt identifiers;
  • authorization phase (challenge, verified, admitted, settling, settled, recorded) and whether settlement became irreversible;
  • task ID and lease/owner identifiers when applicable;
  • public error code plus an internal exception class and dependency name.

Never log payment credentials, wallet private keys, facilitator bearer tokens, SIWX signatures, raw authorization context, or unredacted provider payloads.

Public versus internal messages

Treat error.code as the automation surface. Public messages should be safe and actionable but may evolve; stack traces and provider responses belong in correlated server logs. If your application adds codes, namespace and document them so a client can distinguish Lucid transport errors from business-domain failures.

On this page