Skip to content

Error Ownership and Layered Fault Attribution ​

The Nimi architecture organizes errors through standardized code prefixes and mapping layers, attributing faults to specific subsystems while providing clear remediation paths.

Error Prefixes Across Architectural Layers ​

LayerGoverning AuthorityPrefixScope & Responsibility
Platform Protocol.nimi/spec/platform/core-protocol.authority.yamlP-PROTO-*Cross-world primitive violations, world gating, spacetime continuity
Local Runtime.nimi/spec/runtime/rpc-foundations.authority.yamlK-ERR-*Inference timeouts, driver failures, VRAM exhaustion, invalid tokens
Runtime Streaming.nimi/spec/runtime/rpc-foundations.authority.yamlK-STREAM-*Delta parsing errors, buffer overflows, premature stream termination
SDK Client.nimi/spec/sdks/client-core.authority.yamlS-ERROR-*Application argument validation, transport disconnections, state drift
Desktop Shell.nimi/spec/desktop/shell-ui.authority.yamlrule.nimi.desktop.shell-ui.*UI error boundary catches, retry policies, user notifications

Error Classifications and Remediation Strategies ​

ClassificationManifestationRecommended Remediation Strategy
Transient Transport ErrorsNetwork timeouts, socket resets, HTTP 502/503Retries follow operation idempotency contracts: safe read or idempotent calls may use exponential backoff; operations with unconfirmed external side effects require inspecting the original job/call status rather than blind resubmission
Credential ExpiryExpired tokens, session refreshesRuntime refreshes credentials in the background; resubmission of pending requests must respect operation idempotency and unconfirmed side-effect boundaries
Contract / Validation ErrorsMissing fields, malformed MIME types, schema driftFail closed; inspect structured reason code to fix caller arguments
Streaming InterruptionNetwork drop mid-generation, user stop actionClear transient incomplete tokens while preserving committed turn history

End-to-End Error Propagation Flow ​

When an upstream model provider experiences a transient outage:

  1. Provider Failure: Remote model API returns an HTTP 500 error.
  2. Runtime Classification: Runtime captures the event, classifies it under reason code AI_PROVIDER_INTERNAL (governed by runtime rule K-ERR-*), and logs local audit traces with a Trace ID.
  3. SDK Normalization: The SDK encapsulates the exception into a structured NimiError (with reasonCode: 'AI_PROVIDER_INTERNAL' and the actual actionHint returned for that operation).
  4. Desktop UI Rendering: The UI catches the error at its component boundary, rendering a contextual prompt ("Model provider encountered an internal error; please try again later or switch provider") with actionable retry controls.

Source Basis ​

Documentation for Nimi — the installable, open-source, local-first personal AI product.