Skip to main content

AgentConfigError

Enum AgentConfigError 

Source
#[non_exhaustive]
pub enum AgentConfigError {
Show 16 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, }, 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Io

Filesystem I/O failed. Wraps std::io::Error with the path that caused it.

Fields

§path: PathBuf

The path that triggered the error.

§source: Error

The underlying I/O error.

§

JsonInvalid

A target file existed but contained invalid JSON.

Fields

§path: PathBuf

The path of the malformed file.

§source: Error

The underlying parse error.

§

PathResolution(String)

Could not resolve a platform path (e.g., home directory missing).

§

UnsupportedScope

The integration does not support the requested scope.

Fields

§id: &'static str

Integration id.

§scope: ScopeKind

The rejected scope kind.

§

UnsupportedPlatform

The integration’s surface requires a runtime not present on the current host (for example, a POSIX shell for a bash-script hook).

Fields

§id: &'static str

Integration id.

§reason: &'static str

Why the platform is unsupported.

§

MissingSpecField

The caller-supplied HookSpec is missing a field this integration requires (e.g., gemini needs script, prompt-only agents need rules).

Fields

§id: &'static str

Integration id.

§field: &'static str

The missing field name.

§

InvalidTag

The hook tag is invalid (empty or contains illegal characters).

Fields

§tag: String

The offending tag.

§reason: &'static str

Why it was rejected.

§

InvalidCommand

The caller supplied an invalid hook command.

Fields

§reason: &'static str

Why the command was rejected.

§

InlineSecretInLocalScope

A project-local MCP install tried to write likely secret material into a repository-owned config file.

Fields

§name: String

MCP server name.

§key: String

Environment variable key that looked secret-bearing.

§

BackupExists(PathBuf)

A would-be backup file already exists at <path>.bak.

§

LockTimeout

Could not acquire a filesystem lock before the timeout elapsed.

Fields

§path: PathBuf

The lock file path that remained held.

§

TomlInvalid

A target file existed but contained invalid TOML (Codex config.toml).

Fields

§path: PathBuf

The path of the malformed file.

§source: TomlError

The underlying parse error.

§

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

§kind: &'static str

What kind of resource is in dispute (e.g. "mcp server", "skill").

§name: String

The disputed name.

§expected: String

The expected owner (the caller’s tag).

§actual: Option<String>

The actual recorded owner, if any.

§

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.

Fields

§path: PathBuf

The config file whose content no longer matches the recorded hash.

§

ConfigTooLarge

A config file exceeds the library’s read-size cap, set to prevent a pathological harness config from consuming unbounded memory.

Fields

§path: PathBuf

The oversized config path.

§size: u64

Actual file size.

§limit: u64

The current cap.

§

Other(Error)

Anything else, with context.

Trait Implementations§

Source§

impl Debug for AgentConfigError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AgentConfigError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for AgentConfigError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for AgentConfigError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.