Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/agent / errors
errors
Typed error surface for @graphorin/agent.
Every error class extends the base AgentRuntimeError which is a thin wrapper around Error with a stable code discriminator so callers can switch on it without parsing messages.
Classes
| Class | Description |
|---|---|
| AgentResolutionError | Thrown by runStateFromJSON(...) when the agent name in the serialized state cannot be resolved against the supplied agent graph (renamed agent / removed handoff). |
| AgentRuntimeError | Base class for every error thrown from @graphorin/agent. |
| ConcurrentRunError | Thrown when a second run() / stream() starts while another run is in flight on the same Agent instance (AG-11). The public surface (steer / followUp / abort / compact) addresses "the run" without a run handle, so overlapping runs would share the abort controller, steer queue, and executor bridge - start the second run on its own createAgent(...) instance instead. |
| EvaluatorOptimizerConfigError | Thrown by evaluatorOptimizer({...}) when maxIterations < 1 at construction time. The helper purposely surfaces the misuse early rather than failing on the first run. |
| InvalidAgentConfigError | Thrown by createAgent({...}) when the supplied options fail structural validation (missing provider, empty name, an outputType of kind 'text' carrying a schema, ...). |
| InvalidPreferredModelError | Thrown by createAgent({...}) when preferredModel carries an unknown literal (any value outside the `'fast' |
| MergeBlockedError | Thrown by Agent.fanOut(...) when the configured MergeAgentSidewaysInjectionGuard fires with strictness 'detect-and-block'. |
| MultipleHandoffsInStepError | Base class for every error thrown from @graphorin/agent. |
| ProgressWriteError | Thrown by agent.progress.write(...) when the atomic write fails (disk full, permission denied, ...). The partial .tmp file is unlinked before the error propagates. |
| ProtocolInjectionRejectError | Thrown by the protocol-injection guard when the operator selected the strictest deployment posture (escapePolicy: 'reject') and a tool result body carries control characters at the corresponding outbound boundary. |
| ProviderMiddlewareOrderError | Thrown by createAgent({...}) when the supplied composeProviderMiddleware chain violates the canonical inside-out ordering (DEC-145 / ADR-039). |
| RunStateMalformedError | Thrown by runStateFromJSON(...) when the supplied JSON does not shape-match the documented SerializedRunState. |
| RunStateVersionUnsupportedError | Thrown by runStateFromJSON(...) when the version field in the serialized state is from a future major version of the framework. |
| SubAgentResumeTargetNotFoundError | Thrown when a resume directive routes a decision into a parked sub-agent run (W-001) but the resuming agent instance cannot resolve the target: the parked toolName matches neither a configured handoff target nor a toTool sub-agent tool. Resume a parked sub-run on the SAME parent instance (or an identically-configured one). |
| ToolNotFoundError | Thrown by the agent loop when the model emits a tool call referring to an unregistered tool (the model hallucinated a name). |
Type Aliases
| Type Alias | Description |
|---|---|
| AgentRuntimeErrorCode | Stable code discriminator surfaced on every AgentRuntimeError. |