#[non_exhaustive]pub enum HarnessError {
CapabilityNotSupported {
primitive: String,
},
StaleTarget {
detail: String,
},
Transport {
detail: String,
},
Protocol {
detail: String,
},
Harness {
detail: String,
},
}Expand description
The neutral error taxonomy for the harness-integration seam.
Every arm is harness-neutral. Self::CapabilityNotSupported is the first-class outcome an
observability-only harness returns from crate::AgentSession::intervene for any command —
it is a legitimate, gated rejection, not an internal failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CapabilityNotSupported
The requested intervention primitive is not in the harness’s advertised capability set.
This is the first-class rejection an observability-only harness (empty capability set) returns for every command, and the rejection any harness returns for a primitive it did not advertise. It is a normal, expected outcome of capability gating — not a fault.
StaleTarget
The command targets a stale or unknown activity attempt and is a no-op.
A command addressed to a superseded attempt (a later attempt is now live) or to a session that has already reached its terminal result is dropped without effect.
Transport
The underlying transport failed (spawn/connect failure, broken pipe, EOF, I/O error).
Neutral: it describes that the transport failed and carries the detail, never which transport. An adapter maps its own I/O failures here.
Protocol
A message was received that violates the wire protocol contract.
Malformed framing, an undecodable envelope, a response that correlates to no outstanding request, or a terminal result delivered on the wrong message kind. This signals a bug in the peer or the adapter, distinct from an ordinary transport outage.
Harness
The harness reported an application-level failure while running the agent.
The agent ran but ended in failure (a non-success exit, an error result, a rejected run).
Distinct from Self::Transport (the channel broke) and Self::Protocol (a malformed
message): here the channel and framing were sound and the harness reported failure.
Implementations§
Source§impl HarnessError
impl HarnessError
Sourcepub fn capability_not_supported(primitive: impl Into<String>) -> Self
pub fn capability_not_supported(primitive: impl Into<String>) -> Self
Builds a Self::CapabilityNotSupported naming the unsupported primitive.
Sourcepub fn stale_target(detail: impl Into<String>) -> Self
pub fn stale_target(detail: impl Into<String>) -> Self
Builds a Self::StaleTarget with a detail message.
Sourcepub fn transport(detail: impl Into<String>) -> Self
pub fn transport(detail: impl Into<String>) -> Self
Builds a Self::Transport with a detail message.
Sourcepub fn protocol(detail: impl Into<String>) -> Self
pub fn protocol(detail: impl Into<String>) -> Self
Builds a Self::Protocol with a detail message.
Sourcepub fn harness(detail: impl Into<String>) -> Self
pub fn harness(detail: impl Into<String>) -> Self
Builds a Self::Harness with a detail message.
Trait Implementations§
Source§impl Clone for HarnessError
impl Clone for HarnessError
Source§fn clone(&self) -> HarnessError
fn clone(&self) -> HarnessError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HarnessError
impl Debug for HarnessError
Source§impl Display for HarnessError
impl Display for HarnessError
impl Eq for HarnessError
Source§impl Error for HarnessError
impl Error for HarnessError
1.30.0 · 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()