(
&self,
spec: AgentStepSpec,
_event_tx: Option<broadcast::Sender<AgentEvent>>,
)
| 217 | #[async_trait] |
| 218 | impl AgentExecutor for MockExecutor { |
| 219 | async fn execute_step( |
| 220 | &self, |
| 221 | spec: AgentStepSpec, |
| 222 | _event_tx: Option<broadcast::Sender<AgentEvent>>, |
| 223 | ) -> StepOutcome { |
| 224 | let now = self.active.fetch_add(1, Ordering::SeqCst) + 1; |
| 225 | self.max_active.fetch_max(now, Ordering::SeqCst); |
| 226 | tokio::time::sleep(Duration::from_millis(20)).await; |
| 227 | self.active.fetch_sub(1, Ordering::SeqCst); |
| 228 | |
| 229 | // `boom` panics (exercise branch-panic isolation); `fail` |
| 230 | // returns an unsuccessful outcome. |
| 231 | assert!(spec.agent != "boom", "boom"); |
| 232 | StepOutcome { |
| 233 | task_id: spec.task_id.clone(), |
| 234 | session_id: format!("task-run-{}", spec.task_id), |
| 235 | agent: spec.agent.clone(), |
| 236 | output: format!("ran: {}", spec.prompt), |
| 237 | success: spec.agent != "fail", |
| 238 | structured: None, |
| 239 | } |
| 240 | } |
| 241 | fn concurrency_hint(&self) -> usize { |
| 242 | self.hint |
| 243 | } |
no test coverage detected