Skip to main content

awaken_runtime/registry/resolve/
error.rs

1//! Resolution errors.
2
3/// Errors from the resolution process.
4#[derive(Debug, thiserror::Error)]
5pub enum ResolveError {
6    #[error("agent not found: {0}")]
7    AgentNotFound(String),
8    #[error("model not found: {0}")]
9    ModelNotFound(String),
10    #[error("model id resolves to both a model and a model pool: {0}")]
11    AmbiguousModelReference(String),
12    #[error("provider not found: {0}")]
13    ProviderNotFound(String),
14    #[error("plugin not found: {0}")]
15    PluginNotFound(String),
16    #[error("invalid config for plugin {plugin}: section \"{key}\" — {message}")]
17    InvalidPluginConfig {
18        plugin: String,
19        key: String,
20        message: String,
21    },
22    #[error("unsupported remote backend `{backend}` for delegate `{agent_id}`")]
23    UnsupportedRemoteBackend { agent_id: String, backend: String },
24    #[error(
25        "invalid remote endpoint config for delegate `{agent_id}` backend `{backend}` — {message}"
26    )]
27    InvalidRemoteEndpointConfig {
28        agent_id: String,
29        backend: String,
30        message: String,
31    },
32    #[error("remote agent `{0}` cannot be resolved locally — use it as a delegate instead")]
33    RemoteAgentNotDirectlyRunnable(String),
34    #[error("tool ID conflict: \"{tool_id}\" registered by both {source_a} and {source_b}")]
35    ToolIdConflict {
36        tool_id: String,
37        source_a: String,
38        source_b: String,
39    },
40    #[error("env build error: {0}")]
41    EnvBuild(#[from] awaken_runtime_contract::StateError),
42}