Error handling
CortexRuntimeError exposes a code and outcome classification. Distinguish rejected validation/authority from uncertain issued mutations; an uncertain result does not authorize a new paid attempt.
| Code or state | Host action |
|---|---|
INVALID_INPUT | Fix the submitted contract; preserve the intended semantic identity |
UNAUTHENTICATED, FORBIDDEN, AUTHORITY_EXPIRED, SESSION_CHANGED | Clear/close the affected protected view and verify current identity/grants |
AUTHENTICATION_TIMEOUT, AUTH_TOKEN_FETCH_FAILED | Inspect host token refresh/official handshake |
RPC_DEADLINE_EXCEEDED | Recover the original request/run/job; it may have executed |
IDEMPOTENCY_CONFLICT | Same replay identity carried changed input; resolve the intended request |
POLICY_DENIED | Operator checks qualified function/interface/capability/version and bounds |
CAPABILITY_UNAVAILABLE, PROFILE_NOT_READY | Configure the required capability/profile; never invent success/fallback |
| Context/barrier failure | Inspect captured stage cutoff and watermark hole |
submission_unknown / content unknown | Reconcile saved operation; no blind redispatch |
Disconnect closes an observer. Cancel requests backend cancellation/fences publication; it does not prove an upstream stop/refund. Missing cost data is incurred uncertainty, and an unresolved provider operation can retain liability/concurrency.
Scope/identity changes invalidate old handles. Ignore stale callbacks from an old view after reconnecting a newer one. Clear all private text/history/recall/artifact/job/previews on authority loss; ordinary network errors can preserve the currently authorized view for recovery.
Explicit domain/admin APIs may return committed partial receipts or throw a receipt-bearing error. Inspect the receipt before repeating an effect. See resilience, model policy and runtime client.