Architecture
Error model (ADR-0007)
Structured, typed errors with stable codes — no thrown strings.
Every error in AgentsKitOS extends a base OsError class with:
code— stable string identifier, namespaced (os.flow.cycle_detected)message— human-readable summarycause— optional originating errordata— typed payload (Zod schema per code)
Errors are never thrown as raw strings. Catching code can switch on code to
recover or surface the right UX.
Why stable codes
- Localization and translation can key off
code. - Audit entries reference
codeso dashboards and alerts don't break across message wording changes. - LLM-judge evaluations can be deterministic ("did this run produce code X?").
Categories
os.config.*— schema, layered config conflictsos.workspace.*— lock mismatches, missing filesos.flow.*— cycle, deadline, HITL timeout, branch invalidos.runtime.*— provider failure, tool failure, retry exhaustedos.security.*— capability denied, egress denied, sandbox escape attemptos.audit.*— chain break, signature invalid
Source: ADR-0007.