Skip to main content

zeph_orchestration/
error.rs

1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4use zeph_subagent::SubAgentError;
5
6#[derive(Debug, thiserror::Error)]
7pub enum OrchestrationError {
8    #[error("orchestration is disabled")]
9    Disabled,
10
11    #[error("planning failed: {0}")]
12    PlanningFailed(String),
13
14    #[error("invalid graph: {0}")]
15    InvalidGraph(String),
16
17    #[error("cycle detected in task graph")]
18    CycleDetected,
19
20    #[error("task not found: {0}")]
21    TaskNotFound(String),
22
23    #[error("no agent available for task: {0}")]
24    NoAgentAvailable(String),
25
26    #[error("graph not found: {0}")]
27    GraphNotFound(String),
28
29    #[error("scheduler error: {0}")]
30    Scheduler(String),
31
32    #[error("aggregation failed: {0}")]
33    AggregationFailed(String),
34
35    #[error("persistence error: {0}")]
36    Persistence(String),
37
38    #[error("task timed out: {0}")]
39    TaskTimeout(String),
40
41    #[error("canceled")]
42    Canceled,
43
44    #[error("invalid command: {0}")]
45    InvalidCommand(String),
46
47    /// Hard invariant violation during verification (e.g. cycle detected after `inject_tasks`).
48    /// Never used for LLM call failures — those are fail-open.
49    #[error("verification failed: {0}")]
50    VerificationFailed(String),
51
52    #[error("invalid configuration: {0}")]
53    InvalidConfig(String),
54
55    #[error(transparent)]
56    SubAgent(#[from] SubAgentError),
57}