()
| 390 | |
| 391 | #[tokio::test] |
| 392 | async fn yolo_lane_executes_without_confirmation() { |
| 393 | let (event_tx, _) = broadcast::channel(8); |
| 394 | let manager = Arc::new(ConfirmationManager::new( |
| 395 | ConfirmationPolicy::enabled().with_yolo_lanes([SessionLane::Query]), |
| 396 | event_tx, |
| 397 | )); |
| 398 | let config = AgentConfig { |
| 399 | skill_registry: None, |
| 400 | confirmation_manager: Some(manager), |
| 401 | ..Default::default() |
| 402 | }; |
| 403 | let gate = ToolSafetyGate::new(&config); |
| 404 | |
| 405 | let decision = gate |
| 406 | .decide(ToolGateInput { |
| 407 | tool_name: "read", |
| 408 | args: &json!({"file_path": "README.md"}), |
| 409 | pre_tool_block: None, |
| 410 | }) |
| 411 | .await; |
| 412 | |
| 413 | assert_eq!( |
| 414 | decision, |
| 415 | ToolGateDecision::Execute { |
| 416 | reason: ToolGateApproval::ConfirmationNotRequired, |
| 417 | } |
| 418 | ); |
| 419 | } |
| 420 | } |
nothing calls this directly
no test coverage detected