MCPcopy Create free account
hub / github.com/AI45Lab/Code / yolo_lane_executes_without_confirmation

Function yolo_lane_executes_without_confirmation

core/src/safety_gate.rs:392–419  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 2

with_yolo_lanesMethod · 0.80
decideMethod · 0.80

Tested by

no test coverage detected