#[non_exhaustive]pub enum AgentConfigError {
Show 17 variants
Io {
path: PathBuf,
source: Error,
},
JsonInvalid {
path: PathBuf,
source: Error,
},
PathResolution(String),
UnsupportedScope {
id: &'static str,
scope: ScopeKind,
},
UnsupportedPlatform {
id: &'static str,
reason: &'static str,
},
MissingSpecField {
id: &'static str,
field: &'static str,
},
InvalidTag {
tag: String,
reason: &'static str,
},
UnsupportedTransport {
id: &'static str,
transport: &'static str,
reason: &'static str,
},
InvalidCommand {
reason: &'static str,
},
InlineSecretInLocalScope {
name: String,
key: String,
},
BackupExists(PathBuf),
LockTimeout {
path: PathBuf,
},
TomlInvalid {
path: PathBuf,
source: TomlError,
},
NotOwnedByCaller {
kind: &'static str,
name: String,
expected: String,
actual: Option<String>,
},
ConfigDrifted {
path: PathBuf,
},
ConfigTooLarge {
path: PathBuf,
size: u64,
limit: u64,
},
Other(Error),
}Expand description
All failures returned by agent-config’s public API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
Filesystem I/O failed. Wraps std::io::Error with the path that caused it.
JsonInvalid
A target file existed but contained invalid JSON.
PathResolution(String)
Could not resolve a platform path (e.g., home directory missing).
UnsupportedScope
The integration does not support the requested scope.
UnsupportedPlatform
The integration’s surface requires a runtime not present on the
current host (for example, a POSIX shell for a bash-script hook).
MissingSpecField
The caller-supplied HookSpec is missing a field this
integration requires (e.g., gemini needs script, prompt-only agents
need rules).
InvalidTag
The hook tag is invalid (empty or contains illegal characters).
UnsupportedTransport
The integration does not support this transport kind on this surface.
Fields
InvalidCommand
The caller supplied an invalid hook command.
InlineSecretInLocalScope
A project-local MCP install tried to write likely secret material into a repository-owned config file.
Fields
BackupExists(PathBuf)
A would-be backup file already exists at <path>.bak.
LockTimeout
Could not acquire a filesystem lock before the timeout elapsed.
TomlInvalid
A target file existed but contained invalid TOML (Codex config.toml).
NotOwnedByCaller
Caller tried to uninstall an MCP server or skill that is owned by a different consumer (or by a hand-edit not recorded in the sidecar ledger). Refused to avoid clobbering work this caller did not install.
Fields
ConfigDrifted
A config file has been modified since this library installed an entry into it. The backup will not be restored to avoid overwriting user changes. The caller should inspect the file and resolve the drift manually.
ConfigTooLarge
A config file exceeds the library’s read-size cap, set to prevent a pathological harness config from consuming unbounded memory.
Fields
Other(Error)
Anything else, with context.
Trait Implementations§
Source§impl Debug for AgentConfigError
impl Debug for AgentConfigError
Source§impl Display for AgentConfigError
impl Display for AgentConfigError
Source§impl Error for AgentConfigError
impl Error for AgentConfigError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()