Crux
Errors

Runtime Errors

Stable Runtime Engine diagnostic codes, causes, and fixes.

Runtime Engine public failures use CruxRuntimeError. Every error has a stable code, a user-facing explanation, what still works, and an exact next step.

import { CruxRuntimeError } from "@use-crux/core/runtime";

try {
  await flow.waitFor(event);
} catch (error) {
  if (error instanceof CruxRuntimeError) {
    console.error(error.code, error.nextStep);
  }
}

Codes

CodeMeaning
RUNTIME_REQUIREDA runtime-bound API was called without config({ runtime }).
CAPABILITY_MISSINGThe configured stack cannot support a used runtime feature.
OWNERSHIP_CONFLICTAnother worker already owns maintenance for this store namespace.
SHUTDOWN_TIMEOUTA worker operation did not settle within the shutdown bound.
TARGET_NOT_FOUNDA wake or Effect recovery declaration named a missing or non-recoverable target.
TARGET_DUPLICATETwo runtime targets or Effect recovery identities collide.
TARGET_NOT_EXPORTEDA discovered target cannot be imported as a named export.
REPLAY_DIVERGEDFlow replay no longer matches the suspended snapshot fingerprint.
ARTIFACTS_STALEGenerated runtime artifacts are stale.
WAKE_UNVERIFIEDHTTP wake verification failed before durable state was touched.
PUBLIC_URL_UNRESOLVEDProduction HTTP wake has no stable public URL.
SETUP_REQUIREDRequired adapter resources are missing or mismatched.
PAYLOAD_NOT_JSONA durable runtime payload is not JSON-compatible.
WORK_DEAD_LETTEREDWork exhausted retries and is terminal until operator retry.
WORK_IDEMPOTENCY_CONFLICTA Work idempotency tuple was reused with different input.
WORK_TARGET_MISMATCHWork reconnection used a different exported Flow target.
LEASE_LOSTA stale worker tried to commit after losing its lease.
NAMESPACE_AMBIGUOUSThe inferred runtime namespace is unsafe or ambiguous.
RUNTIME_HOST_ONLYA host-bound runtime was used outside its host boundary.
EVAL_REACTIVE_DISPATCH_FORBIDDENEval execution attempted to wake durable reactive work.

Durable Agent Session codes

Public Session failures use dedicated error classes from @use-crux/core / @use-crux/core/session. Generation-model and recovery codes extend CruxRuntimeError.

CodeMeaning
SESSION_IDENTITY_CONFLICTA Session key is already bound to another Agent target.
SESSION_NOT_FOUNDNo Session exists for the key in this Runtime namespace.
SESSION_INPUT_INVALIDInput failed Prompt schema or JSON-safety admission.
SESSION_UNSUPPORTEDThe Runtime store cannot persist Agent Sessions.
GENERATION_MODEL_BINDING_MISSINGNo adapter-bound GenerationModel on Session or Agent.
GENERATION_MODEL_NOT_STATICSelected model is absent from the Runtime program.
GENERATION_CAPABILITY_MISSINGModel cannot cover the Agent language requirements.
SESSION_TURN_RESULT_ARTIFACT_UNAVAILABLEPrepared turn result evidence is missing for recovery.

Request-scoped defer codes

Public defer() failures use CruxDeferError from @use-crux/core.

CodeMeaning
DEFER_SCOPE_REQUIREDNo active execution scope or ambient host binding.
DEFER_CAPABILITY_MISSINGActive scope cannot honor this overload.
DEFER_SCOPE_SEALEDRegistration after the invocation sealed.
DEFER_LIMIT_EXCEEDEDHost callback/nesting bounds exceeded.
DEFER_REPLAY_UNSAFEPublic defer() inside replayable flow execution.
DEFER_TARGET_INPUT_REQUIREDNamed target missing required JSON input.
DEFER_COMMIT_FAILEDNamed work could not commit before the response.

Effects codes

Public custom-effect failures use CruxEffectError from @use-crux/core/effect. EffectOutcomeUnknownError and RollbackError provide additional structured fields for ambiguity and incomplete rollback.

CodeMeaning
EFFECT_DUPLICATE_IDTwo effect definitions share one id and version.
EFFECT_RESOURCE_FAILEDResource projection failed before execution.
EFFECT_CAPTURE_FAILEDRecovery pre-state capture failed before execution.
EFFECT_RECOVERY_REQUIREDA required-recovery boundary blocked an irreversible effect.
EFFECT_SCOPE_NOT_FOUNDA rollback scope ref is invalid or unavailable.
EFFECT_RECEIPT_NOT_FOUNDA receipt ref is invalid, unavailable, or belongs to another definition.
EFFECT_SCOPE_TERMINALNew work targeted a boundary that is rolling back or closed.
EFFECT_OUTCOME_AMBIGUOUSAn external outcome is unknown or cannot be reconciled safely.
EFFECT_ROLLBACK_PARTIALA required rollback did not complete.

Execution evidence codes

CruxEvidenceError covers synchronous authoring and inspection failures. Crux Local also returns evidence-specific asynchronous delivery dispositions.

CodeMeaning
EVIDENCE_INPUT_INVALIDAn evidence input or destination result is structurally invalid.
EVIDENCE_SUBJECT_REQUIREDNo explicit or active execution subject exists.
EVIDENCE_SUBJECT_NOT_FOUNDThe readable destination cannot resolve the subject.
EVIDENCE_KIND_INVALIDThe evidence kind is invalid or unresolved.
EVIDENCE_CONCLUSION_INVALIDThe conclusion does not belong to the selected role.
EVIDENCE_REFERENCE_INVALIDThe subject or source cannot become a canonical graph reference.
EVIDENCE_SUPERSESSION_INVALIDThe supersession relationship is invalid.
EVIDENCE_IDEMPOTENCY_CONFLICTContent differs from the first accepted evidence identity.
EVIDENCE_WRITE_QUARANTINEDA closed Eval cell rejected late evidence authoring.
EVIDENCE_QUERY_UNAVAILABLENo active collector or readable destination can answer.
EVIDENCE_CURSOR_INVALIDThe cursor is invalid, stale, or bound to another query.
EVIDENCE_ACCESS_DENIEDThe destination denied evidence inspection.
EVIDENCE_INPUT_TOO_LARGEA bounded Local evidence request exceeded its input limit.
EVIDENCE_QUERY_FAILEDLocal could not complete the evidence query.
EVIDENCE_STAGING_CAPACITYDurable evidence staging is temporarily full.
EVIDENCE_STAGING_CANDIDATE_TOO_LARGEOne evidence payload candidate exceeds the fixed bound.
EVIDENCE_PRIVACY_DELETEDDelivery references explicitly deleted private state.

On this page