aether_evals/agents/
agent.rs1use crate::{Task, containers::ContainerError};
2use aether_core::events::AgentMessage;
3use futures::Stream;
4use thiserror::Error;
5
6pub type AgentRunResult = Result<AgentMessage, RunError>;
7
8pub trait Agent: Send + Sync {
19 fn run(&self, task: Task) -> impl Stream<Item = AgentRunResult> + Send + '_;
20}
21
22#[derive(Debug, Error)]
24pub enum RunError {
25 #[error("Agent execution failed: {0}")]
26 ExecutionFailed(String),
27
28 #[error("Agent configuration error: {0}")]
29 ConfigurationError(String),
30
31 #[error("Agent command exited without emitting a terminal AgentMessage: {stderr}")]
32 CommandExitWithoutTerminal { stderr: String },
33
34 #[error("Agent command emitted invalid AgentMessage JSON line: {line}")]
35 AgentMessageJsonLine {
36 line: String,
37 #[source]
38 source: serde_json::Error,
39 },
40
41 #[error(transparent)]
42 Container(#[from] ContainerError),
43}